aboutsummaryrefslogtreecommitdiffstats
path: root/test/sysutils/tar.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/sysutils/tar.exp')
-rwxr-xr-xtest/sysutils/tar.exp46
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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail /bin/tar -cjvf firejail_t2 /usr/share/doc/firejail\r"
11expect {
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}
16after 100
17
18send -- "stat -c '|%s|' firejail_t2; uname -s\r"
19expect {
20 timeout {puts "TESTING ERROR 2.1\n";exit}
21 "|0|" {puts "TESTING ERROR 2.2\n";exit}
22 "Linux"
23}
24sleep 1
25
26send -- "firejail /bin/tar --compare --file=firejail_t2 -C / | wc\r"
27expect {
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}
32sleep 1
33send -- "/bin/tar --compare --file=firejail_t2 -C / | wc\r"
34expect {
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}
39sleep 1
40
41
42send -- "rm firejail_t*\r"
43sleep 1
44
45
46puts "\nall done\n"