diff options
-rwxr-xr-x | test/fbreader.exp | 72 | ||||
-rwxr-xr-x | test/icedove.exp | 72 | ||||
-rwxr-xr-x | test/test.sh | 30 | ||||
-rwxr-xr-x | test/vlc.exp | 72 |
4 files changed, 246 insertions, 0 deletions
diff --git a/test/fbreader.exp b/test/fbreader.exp new file mode 100755 index 000000000..546710b97 --- /dev/null +++ b/test/fbreader.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 fbreader\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Reading profile /etc/firejail/fbreader.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 | "fbreader" | ||
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 fbreader" | ||
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 fbreader" | ||
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 "\nall done\n" | ||
72 | |||
diff --git a/test/icedove.exp b/test/icedove.exp new file mode 100755 index 000000000..79913517b --- /dev/null +++ b/test/icedove.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 icedove\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Reading profile /etc/firejail/icedove.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 | "icedove" | ||
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 icedove" | ||
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 icedove" | ||
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 "\nall done\n" | ||
72 | |||
diff --git a/test/test.sh b/test/test.sh index 2e7b1e2bc..bca7c41e9 100755 --- a/test/test.sh +++ b/test/test.sh | |||
@@ -206,6 +206,36 @@ else | |||
206 | echo "TESTING: evince not found" | 206 | echo "TESTING: evince not found" |
207 | fi | 207 | fi |
208 | 208 | ||
209 | which icedove | ||
210 | if [ "$?" -eq 0 ]; | ||
211 | then | ||
212 | echo "TESTING: icedove" | ||
213 | ./icedove.exp | ||
214 | else | ||
215 | echo "TESTING: icedove not found" | ||
216 | fi | ||
217 | |||
218 | which vlc | ||
219 | if [ "$?" -eq 0 ]; | ||
220 | then | ||
221 | echo "TESTING: vlc" | ||
222 | ./vlc.exp | ||
223 | else | ||
224 | echo "TESTING: vlc not found" | ||
225 | fi | ||
226 | |||
227 | which fbreader | ||
228 | if [ "$?" -eq 0 ]; | ||
229 | then | ||
230 | echo "TESTING: fbreader" | ||
231 | ./vlc.exp | ||
232 | else | ||
233 | echo "TESTING: fbreader not found" | ||
234 | fi | ||
235 | |||
236 | |||
237 | |||
238 | |||
209 | echo "TESTING: PID" | 239 | echo "TESTING: PID" |
210 | ./pid.exp | 240 | ./pid.exp |
211 | 241 | ||
diff --git a/test/vlc.exp b/test/vlc.exp new file mode 100755 index 000000000..8ab5aa2ce --- /dev/null +++ b/test/vlc.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 vlc\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Reading profile /etc/firejail/vlc.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 | "vlc" | ||
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 vlc" | ||
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 vlc" | ||
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 "\nall done\n" | ||
72 | |||