diff options
Diffstat (limited to 'test')
-rwxr-xr-x | test/chromium-x11.exp | 75 | ||||
-rwxr-xr-x | test/firefox-x11.exp | 68 | ||||
-rwxr-xr-x | test/test-apps-x11.sh | 29 | ||||
-rwxr-xr-x | test/test.sh | 1 | ||||
-rwxr-xr-x | test/transmission-gtk-x11.exp | 74 |
5 files changed, 247 insertions, 0 deletions
diff --git a/test/chromium-x11.exp b/test/chromium-x11.exp new file mode 100755 index 000000000..0d8a5dfb3 --- /dev/null +++ b/test/chromium-x11.exp | |||
@@ -0,0 +1,75 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --name=test --x11 --net=br0 chromium www.gentoo.org\r" | ||
8 | sleep 10 | ||
9 | |||
10 | spawn $env(SHELL) | ||
11 | send -- "firejail --list\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 3\n";exit} | ||
14 | ":firejail" | ||
15 | } | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
18 | "chromium" | ||
19 | } | ||
20 | sleep 1 | ||
21 | |||
22 | send -- "firejail --name=blablabla\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 4\n";exit} | ||
25 | "Child process initialized" | ||
26 | } | ||
27 | sleep 2 | ||
28 | |||
29 | spawn $env(SHELL) | ||
30 | send -- "firemon --seccomp\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 5\n";exit} | ||
33 | ":firejail" | ||
34 | } | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 5.0\n";exit} | ||
37 | "chromium" | ||
38 | } | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
41 | "Seccomp: 0" | ||
42 | } | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
45 | "name=blablabla" | ||
46 | } | ||
47 | sleep 1 | ||
48 | send -- "firemon --caps\r" | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 6\n";exit} | ||
51 | ":firejail" | ||
52 | } | ||
53 | expect { | ||
54 | timeout {puts "TESTING ERROR 6.0\n";exit} | ||
55 | "chromium" | ||
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 | "fffffffff" | ||
64 | } | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
67 | "name=blablabla" | ||
68 | } | ||
69 | sleep 1 | ||
70 | send -- "firejail --shutdown=test\r" | ||
71 | sleep 3 | ||
72 | |||
73 | |||
74 | puts "\nall done\n" | ||
75 | |||
diff --git a/test/firefox-x11.exp b/test/firefox-x11.exp new file mode 100755 index 000000000..c82408896 --- /dev/null +++ b/test/firefox-x11.exp | |||
@@ -0,0 +1,68 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --name=test --x11 --net=br0 firefox www.gentoo.org\r" | ||
8 | sleep 10 | ||
9 | |||
10 | spawn $env(SHELL) | ||
11 | send -- "firejail --list\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 3\n";exit} | ||
14 | ":firejail" | ||
15 | } | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
18 | "firefox" {puts "firefox detected\n";} | ||
19 | "iceweasel" {puts "iceweasel detected\n";} | ||
20 | } | ||
21 | sleep 1 | ||
22 | send -- "firejail --name=blablabla\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 4\n";exit} | ||
25 | "Child process initialized" | ||
26 | } | ||
27 | sleep 2 | ||
28 | |||
29 | spawn $env(SHELL) | ||
30 | send -- "firemon --seccomp\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 5\n";exit} | ||
33 | " firefox" {puts "firefox detected\n";} | ||
34 | " iceweasel" {puts "iceweasel detected\n";} | ||
35 | } | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} | ||
38 | "Seccomp: 2" | ||
39 | } | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
42 | "name=blablabla" | ||
43 | } | ||
44 | sleep 1 | ||
45 | send -- "firemon --caps\r" | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 6\n";exit} | ||
48 | " firefox" {puts "firefox detected\n";} | ||
49 | " iceweasel" {puts "iceweasel detected\n";} | ||
50 | } | ||
51 | expect { | ||
52 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
53 | "CapBnd:" | ||
54 | } | ||
55 | expect { | ||
56 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
57 | "0000000000000000" | ||
58 | } | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
61 | "name=blablabla" | ||
62 | } | ||
63 | sleep 1 | ||
64 | send -- "firejail --shutdown=test\r" | ||
65 | sleep 3 | ||
66 | |||
67 | puts "\nall done\n" | ||
68 | |||
diff --git a/test/test-apps-x11.sh b/test/test-apps-x11.sh new file mode 100755 index 000000000..6521fa2b0 --- /dev/null +++ b/test/test-apps-x11.sh | |||
@@ -0,0 +1,29 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | which firefox | ||
4 | if [ "$?" -eq 0 ]; | ||
5 | then | ||
6 | echo "TESTING: firefox x11" | ||
7 | ./firefox-x11.exp | ||
8 | else | ||
9 | echo "TESTING: firefox not found" | ||
10 | fi | ||
11 | |||
12 | which chromium | ||
13 | if [ "$?" -eq 0 ]; | ||
14 | then | ||
15 | echo "TESTING: chromium x11" | ||
16 | ./chromium-x11.exp | ||
17 | else | ||
18 | echo "TESTING: chromium not found" | ||
19 | fi | ||
20 | |||
21 | which transmission-gtk | ||
22 | if [ "$?" -eq 0 ]; | ||
23 | then | ||
24 | echo "TESTING: transmission-gtk x11" | ||
25 | ./transmission-gtk.exp | ||
26 | else | ||
27 | echo "TESTING: transmission-gtk not found" | ||
28 | fi | ||
29 | |||
diff --git a/test/test.sh b/test/test.sh index ddb8431c8..d7e9e2aed 100755 --- a/test/test.sh +++ b/test/test.sh | |||
@@ -166,6 +166,7 @@ else | |||
166 | fi | 166 | fi |
167 | 167 | ||
168 | ./test-apps.sh | 168 | ./test-apps.sh |
169 | ./test-apps-x11.sh | ||
169 | 170 | ||
170 | echo "TESTING: PID (pid.exp)" | 171 | echo "TESTING: PID (pid.exp)" |
171 | ./pid.exp | 172 | ./pid.exp |
diff --git a/test/transmission-gtk-x11.exp b/test/transmission-gtk-x11.exp new file mode 100755 index 000000000..6192b277c --- /dev/null +++ b/test/transmission-gtk-x11.exp | |||
@@ -0,0 +1,74 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --name=test --net=br0 --x11 transmission-gtk\r" | ||
8 | sleep 10 | ||
9 | |||
10 | spawn $env(SHELL) | ||
11 | send -- "firejail --list\r" | ||
12 | expect { | ||
13 | timeout {puts "TESTING ERROR 3\n";exit} | ||
14 | ":firejail" | ||
15 | } | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
18 | "transmission-gtk" | ||
19 | } | ||
20 | sleep 1 | ||
21 | |||
22 | send -- "firejail --name=blablabla\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 4\n";exit} | ||
25 | "Child process initialized" | ||
26 | } | ||
27 | sleep 2 | ||
28 | |||
29 | spawn $env(SHELL) | ||
30 | send -- "firemon --seccomp\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 5\n";exit} | ||
33 | ":firejail" | ||
34 | } | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 5.0\n";exit} | ||
37 | "transmission-gtk" | ||
38 | } | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} | ||
41 | "Seccomp: 2" | ||
42 | } | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
45 | "name=blablabla" | ||
46 | } | ||
47 | sleep 1 | ||
48 | send -- "firemon --caps\r" | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 6\n";exit} | ||
51 | ":firejail" | ||
52 | } | ||
53 | expect { | ||
54 | timeout {puts "TESTING ERROR 6.0\n";exit} | ||
55 | "transmission-gtk" | ||
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 | send -- "firejail --shutdown=test\r" | ||
71 | sleep 3 | ||
72 | |||
73 | puts "\nall done\n" | ||
74 | |||