aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-02-23 08:43:05 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-02-23 08:43:05 -0500
commit4e86686da02b39e650edbb80e2fc837d2ccd3a33 (patch)
tree64de359a6637aad926ad5a9b398365d99aab408f /test
parentMerge pull request #315 from vn971/master (diff)
downloadfirejail-4e86686da02b39e650edbb80e2fc837d2ccd3a33.tar.gz
firejail-4e86686da02b39e650edbb80e2fc837d2ccd3a33.tar.zst
firejail-4e86686da02b39e650edbb80e2fc837d2ccd3a33.zip
x11 work
Diffstat (limited to 'test')
-rwxr-xr-xtest/chromium-x11.exp75
-rwxr-xr-xtest/firefox-x11.exp68
-rwxr-xr-xtest/test-apps-x11.sh29
-rwxr-xr-xtest/test.sh1
-rwxr-xr-xtest/transmission-gtk-x11.exp74
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
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --name=test --x11 --net=br0 chromium www.gentoo.org\r"
8sleep 10
9
10spawn $env(SHELL)
11send -- "firejail --list\r"
12expect {
13 timeout {puts "TESTING ERROR 3\n";exit}
14 ":firejail"
15}
16expect {
17 timeout {puts "TESTING ERROR 3.1\n";exit}
18 "chromium"
19}
20sleep 1
21
22send -- "firejail --name=blablabla\r"
23expect {
24 timeout {puts "TESTING ERROR 4\n";exit}
25 "Child process initialized"
26}
27sleep 2
28
29spawn $env(SHELL)
30send -- "firemon --seccomp\r"
31expect {
32 timeout {puts "TESTING ERROR 5\n";exit}
33 ":firejail"
34}
35expect {
36 timeout {puts "TESTING ERROR 5.0\n";exit}
37 "chromium"
38}
39expect {
40 timeout {puts "TESTING ERROR 5.1\n";exit}
41 "Seccomp: 0"
42}
43expect {
44 timeout {puts "TESTING ERROR 5.1\n";exit}
45 "name=blablabla"
46}
47sleep 1
48send -- "firemon --caps\r"
49expect {
50 timeout {puts "TESTING ERROR 6\n";exit}
51 ":firejail"
52}
53expect {
54 timeout {puts "TESTING ERROR 6.0\n";exit}
55 "chromium"
56}
57expect {
58 timeout {puts "TESTING ERROR 6.1\n";exit}
59 "CapBnd:"
60}
61expect {
62 timeout {puts "TESTING ERROR 6.2\n";exit}
63 "fffffffff"
64}
65expect {
66 timeout {puts "TESTING ERROR 6.3\n";exit}
67 "name=blablabla"
68}
69sleep 1
70send -- "firejail --shutdown=test\r"
71sleep 3
72
73
74puts "\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
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --name=test --x11 --net=br0 firefox www.gentoo.org\r"
8sleep 10
9
10spawn $env(SHELL)
11send -- "firejail --list\r"
12expect {
13 timeout {puts "TESTING ERROR 3\n";exit}
14 ":firejail"
15}
16expect {
17 timeout {puts "TESTING ERROR 3.1\n";exit}
18 "firefox" {puts "firefox detected\n";}
19 "iceweasel" {puts "iceweasel detected\n";}
20}
21sleep 1
22send -- "firejail --name=blablabla\r"
23expect {
24 timeout {puts "TESTING ERROR 4\n";exit}
25 "Child process initialized"
26}
27sleep 2
28
29spawn $env(SHELL)
30send -- "firemon --seccomp\r"
31expect {
32 timeout {puts "TESTING ERROR 5\n";exit}
33 " firefox" {puts "firefox detected\n";}
34 " iceweasel" {puts "iceweasel detected\n";}
35}
36expect {
37 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
38 "Seccomp: 2"
39}
40expect {
41 timeout {puts "TESTING ERROR 5.1\n";exit}
42 "name=blablabla"
43}
44sleep 1
45send -- "firemon --caps\r"
46expect {
47 timeout {puts "TESTING ERROR 6\n";exit}
48 " firefox" {puts "firefox detected\n";}
49 " iceweasel" {puts "iceweasel detected\n";}
50}
51expect {
52 timeout {puts "TESTING ERROR 6.1\n";exit}
53 "CapBnd:"
54}
55expect {
56 timeout {puts "TESTING ERROR 6.2\n";exit}
57 "0000000000000000"
58}
59expect {
60 timeout {puts "TESTING ERROR 6.3\n";exit}
61 "name=blablabla"
62}
63sleep 1
64send -- "firejail --shutdown=test\r"
65sleep 3
66
67puts "\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
3which firefox
4if [ "$?" -eq 0 ];
5then
6 echo "TESTING: firefox x11"
7 ./firefox-x11.exp
8else
9 echo "TESTING: firefox not found"
10fi
11
12which chromium
13if [ "$?" -eq 0 ];
14then
15 echo "TESTING: chromium x11"
16 ./chromium-x11.exp
17else
18 echo "TESTING: chromium not found"
19fi
20
21which transmission-gtk
22if [ "$?" -eq 0 ];
23then
24 echo "TESTING: transmission-gtk x11"
25 ./transmission-gtk.exp
26else
27 echo "TESTING: transmission-gtk not found"
28fi
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
166fi 166fi
167 167
168./test-apps.sh 168./test-apps.sh
169./test-apps-x11.sh
169 170
170echo "TESTING: PID (pid.exp)" 171echo "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
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --name=test --net=br0 --x11 transmission-gtk\r"
8sleep 10
9
10spawn $env(SHELL)
11send -- "firejail --list\r"
12expect {
13 timeout {puts "TESTING ERROR 3\n";exit}
14 ":firejail"
15}
16expect {
17 timeout {puts "TESTING ERROR 3.1\n";exit}
18 "transmission-gtk"
19}
20sleep 1
21
22send -- "firejail --name=blablabla\r"
23expect {
24 timeout {puts "TESTING ERROR 4\n";exit}
25 "Child process initialized"
26}
27sleep 2
28
29spawn $env(SHELL)
30send -- "firemon --seccomp\r"
31expect {
32 timeout {puts "TESTING ERROR 5\n";exit}
33 ":firejail"
34}
35expect {
36 timeout {puts "TESTING ERROR 5.0\n";exit}
37 "transmission-gtk"
38}
39expect {
40 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
41 "Seccomp: 2"
42}
43expect {
44 timeout {puts "TESTING ERROR 5.1\n";exit}
45 "name=blablabla"
46}
47sleep 1
48send -- "firemon --caps\r"
49expect {
50 timeout {puts "TESTING ERROR 6\n";exit}
51 ":firejail"
52}
53expect {
54 timeout {puts "TESTING ERROR 6.0\n";exit}
55 "transmission-gtk"
56}
57expect {
58 timeout {puts "TESTING ERROR 6.1\n";exit}
59 "CapBnd"
60}
61expect {
62 timeout {puts "TESTING ERROR 6.2\n";exit}
63 "0000000000000000"
64}
65expect {
66 timeout {puts "TESTING ERROR 6.3\n";exit}
67 "name=blablabla"
68}
69sleep 1
70send -- "firejail --shutdown=test\r"
71sleep 3
72
73puts "\nall done\n"
74