diff options
author | netblue30 <netblue30@yahoo.com> | 2016-07-31 10:06:41 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-07-31 10:06:41 -0400 |
commit | 59cd5a6b6bb90d316d7f628fd6fc2df9ff2b17ab (patch) | |
tree | b8e44859848ece18a81e63afc7910d0d0a4ca544 /test/sysutils | |
parent | Merge pull request #662 from reinerh/master (diff) | |
download | firejail-59cd5a6b6bb90d316d7f628fd6fc2df9ff2b17ab.tar.gz firejail-59cd5a6b6bb90d316d7f628fd6fc2df9ff2b17ab.tar.zst firejail-59cd5a6b6bb90d316d7f628fd6fc2df9ff2b17ab.zip |
cleanup and some new tests
Diffstat (limited to 'test/sysutils')
-rwxr-xr-x | test/sysutils/file.exp | 16 | ||||
-rwxr-xr-x | test/sysutils/sysutils.sh | 18 | ||||
-rwxr-xr-x | test/sysutils/tar.exp | 35 |
3 files changed, 69 insertions, 0 deletions
diff --git a/test/sysutils/file.exp b/test/sysutils/file.exp new file mode 100755 index 000000000..e40b83197 --- /dev/null +++ b/test/sysutils/file.exp | |||
@@ -0,0 +1,16 @@ | |||
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 file ~/.bashrc\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1\n";exit} | ||
13 | "ASCII text" | ||
14 | } | ||
15 | |||
16 | puts "\nall done\n" | ||
diff --git a/test/sysutils/sysutils.sh b/test/sysutils/sysutils.sh index d75738f97..315b73c9d 100755 --- a/test/sysutils/sysutils.sh +++ b/test/sysutils/sysutils.sh | |||
@@ -60,3 +60,21 @@ else | |||
60 | echo "TESTING SKIP: less not found" | 60 | echo "TESTING SKIP: less not found" |
61 | fi | 61 | fi |
62 | 62 | ||
63 | which file | ||
64 | if [ "$?" -eq 0 ]; | ||
65 | then | ||
66 | echo "TESTING: file" | ||
67 | ./file.exp | ||
68 | else | ||
69 | echo "TESTING SKIP: file not found" | ||
70 | fi | ||
71 | |||
72 | which tar | ||
73 | if [ "$?" -eq 0 ]; | ||
74 | then | ||
75 | echo "TESTING: tar" | ||
76 | ./tar.exp | ||
77 | else | ||
78 | echo "TESTING SKIP: tar not found" | ||
79 | fi | ||
80 | |||
diff --git a/test/sysutils/tar.exp b/test/sysutils/tar.exp new file mode 100755 index 000000000..af569f5ac --- /dev/null +++ b/test/sysutils/tar.exp | |||
@@ -0,0 +1,35 @@ | |||
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\n";exit} | ||
13 | "/usr/share/doc/firejail/README" | ||
14 | } | ||
15 | after 100 | ||
16 | |||
17 | send -- "firejail /bin/tar --compare --file=firejail_t2 -C / | wc\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 2\n";exit} | ||
20 | " 0 0 0" | ||
21 | } | ||
22 | sleep 1 | ||
23 | send -- "/bin/tar --compare --file=firejail_t2 -C / | wc\r" | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 3\n";exit} | ||
26 | " 0 0 0" | ||
27 | } | ||
28 | sleep 1 | ||
29 | |||
30 | |||
31 | send -- "rm firejail_t*\r" | ||
32 | sleep 1 | ||
33 | |||
34 | |||
35 | puts "\nall done\n" | ||