diff options
author | netblue30 <netblue30@yahoo.com> | 2015-10-16 09:38:18 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-10-16 09:38:18 -0400 |
commit | ab29174701697c6ea844bb81d48d0965fcee352d (patch) | |
tree | 3075c2d3e7b327f1d9e3c1de66dc8fe9d83894e6 | |
parent | seccomp testing (diff) | |
download | firejail-ab29174701697c6ea844bb81d48d0965fcee352d.tar.gz firejail-ab29174701697c6ea844bb81d48d0965fcee352d.tar.zst firejail-ab29174701697c6ea844bb81d48d0965fcee352d.zip |
testing
-rwxr-xr-x | test/deluge.exp | 72 | ||||
-rwxr-xr-x | test/gnome-mplayer.exp | 72 | ||||
-rwxr-xr-x | test/test.sh | 21 |
3 files changed, 164 insertions, 1 deletions
diff --git a/test/deluge.exp b/test/deluge.exp new file mode 100755 index 000000000..49266813e --- /dev/null +++ b/test/deluge.exp | |||
@@ -0,0 +1,72 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail deluge\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Reading profile /etc/firejail/deluge.profile" | ||
11 | } | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 1\n";exit} | ||
14 | "Child process initialized" | ||
15 | } | ||
16 | sleep 10 | ||
17 | |||
18 | spawn $env(SHELL) | ||
19 | send -- "firejail --list\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 3\n";exit} | ||
22 | ":firejail" | ||
23 | } | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
26 | "deluge" | ||
27 | } | ||
28 | sleep 1 | ||
29 | |||
30 | send -- "firejail --name=blablabla\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 4\n";exit} | ||
33 | "Child process initialized" | ||
34 | } | ||
35 | sleep 2 | ||
36 | |||
37 | spawn $env(SHELL) | ||
38 | send -- "firemon --seccomp\r" | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 5\n";exit} | ||
41 | ":firejail deluge" | ||
42 | } | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} | ||
45 | "Seccomp: 2" | ||
46 | } | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
49 | "name=blablabla" | ||
50 | } | ||
51 | sleep 1 | ||
52 | send -- "firemon --caps\r" | ||
53 | expect { | ||
54 | timeout {puts "TESTING ERROR 6\n";exit} | ||
55 | ":firejail deluge" | ||
56 | } | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
59 | "CapBnd:" | ||
60 | } | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
63 | "0000000000000000" | ||
64 | } | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
67 | "name=blablabla" | ||
68 | } | ||
69 | sleep 1 | ||
70 | |||
71 | puts "\n" | ||
72 | |||
diff --git a/test/gnome-mplayer.exp b/test/gnome-mplayer.exp new file mode 100755 index 000000000..e8acc295c --- /dev/null +++ b/test/gnome-mplayer.exp | |||
@@ -0,0 +1,72 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail gnome-mplayer\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Reading profile /etc/firejail/gnome-mplayer.profile" | ||
11 | } | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 1\n";exit} | ||
14 | "Child process initialized" | ||
15 | } | ||
16 | sleep 10 | ||
17 | |||
18 | spawn $env(SHELL) | ||
19 | send -- "firejail --list\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 3\n";exit} | ||
22 | ":firejail" | ||
23 | } | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
26 | "gnome-mplayer" | ||
27 | } | ||
28 | sleep 1 | ||
29 | |||
30 | send -- "firejail --name=blablabla\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 4\n";exit} | ||
33 | "Child process initialized" | ||
34 | } | ||
35 | sleep 2 | ||
36 | |||
37 | spawn $env(SHELL) | ||
38 | send -- "firemon --seccomp\r" | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 5\n";exit} | ||
41 | ":firejail gnome-mplayer" | ||
42 | } | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} | ||
45 | "Seccomp: 2" | ||
46 | } | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
49 | "name=blablabla" | ||
50 | } | ||
51 | sleep 1 | ||
52 | send -- "firemon --caps\r" | ||
53 | expect { | ||
54 | timeout {puts "TESTING ERROR 6\n";exit} | ||
55 | ":firejail gnome-mplayer" | ||
56 | } | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
59 | "CapBnd:" | ||
60 | } | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
63 | "0000000000000000" | ||
64 | } | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
67 | "name=blablabla" | ||
68 | } | ||
69 | sleep 1 | ||
70 | |||
71 | puts "\n" | ||
72 | |||
diff --git a/test/test.sh b/test/test.sh index bca7c41e9..80aa7f3e8 100755 --- a/test/test.sh +++ b/test/test.sh | |||
@@ -228,11 +228,30 @@ which fbreader | |||
228 | if [ "$?" -eq 0 ]; | 228 | if [ "$?" -eq 0 ]; |
229 | then | 229 | then |
230 | echo "TESTING: fbreader" | 230 | echo "TESTING: fbreader" |
231 | ./vlc.exp | 231 | ./fbreader.exp |
232 | else | 232 | else |
233 | echo "TESTING: fbreader not found" | 233 | echo "TESTING: fbreader not found" |
234 | fi | 234 | fi |
235 | 235 | ||
236 | which deluge | ||
237 | if [ "$?" -eq 0 ]; | ||
238 | then | ||
239 | echo "TESTING: deluge" | ||
240 | ./deluge.exp | ||
241 | else | ||
242 | echo "TESTING: deluge not found" | ||
243 | fi | ||
244 | |||
245 | which gnome-mplayer | ||
246 | if [ "$?" -eq 0 ]; | ||
247 | then | ||
248 | echo "TESTING: gnome-mplayer" | ||
249 | ./gnome-mplayer.exp | ||
250 | else | ||
251 | echo "TESTING: gnome-mplayer not found" | ||
252 | fi | ||
253 | |||
254 | |||
236 | 255 | ||
237 | 256 | ||
238 | 257 | ||