diff options
Diffstat (limited to 'test/sysutils/tar.exp')
-rwxr-xr-x | test/sysutils/tar.exp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/test/sysutils/tar.exp b/test/sysutils/tar.exp new file mode 100755 index 000000000..f41d67d6f --- /dev/null +++ b/test/sysutils/tar.exp | |||
@@ -0,0 +1,46 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail /bin/tar -cjvf firejail_t2 /usr/share/doc/firejail\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
13 | "Error" {puts "TESTING ERROR 1.2\n";exit} | ||
14 | "/usr/share/doc/firejail/README" | ||
15 | } | ||
16 | after 100 | ||
17 | |||
18 | send -- "stat -c '|%s|' firejail_t2; uname -s\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 2.1\n";exit} | ||
21 | "|0|" {puts "TESTING ERROR 2.2\n";exit} | ||
22 | "Linux" | ||
23 | } | ||
24 | sleep 1 | ||
25 | |||
26 | send -- "firejail /bin/tar --compare --file=firejail_t2 -C / | wc\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
29 | "This does not look like a tar archive" {puts "TESTING ERROR 3.2\n"; exit} | ||
30 | " 0 0 0" | ||
31 | } | ||
32 | sleep 1 | ||
33 | send -- "/bin/tar --compare --file=firejail_t2 -C / | wc\r" | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 4.1\n";exit} | ||
36 | "This does not look like a tar archive" {puts "TESTING ERROR 4.2\n"; exit} | ||
37 | " 0 0 0" | ||
38 | } | ||
39 | sleep 1 | ||
40 | |||
41 | |||
42 | send -- "rm firejail_t*\r" | ||
43 | sleep 1 | ||
44 | |||
45 | |||
46 | puts "\nall done\n" | ||