aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-10-16 09:38:18 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2015-10-16 09:38:18 -0400
commitab29174701697c6ea844bb81d48d0965fcee352d (patch)
tree3075c2d3e7b327f1d9e3c1de66dc8fe9d83894e6
parentseccomp testing (diff)
downloadfirejail-ab29174701697c6ea844bb81d48d0965fcee352d.tar.gz
firejail-ab29174701697c6ea844bb81d48d0965fcee352d.tar.zst
firejail-ab29174701697c6ea844bb81d48d0965fcee352d.zip
testing
-rwxr-xr-xtest/deluge.exp72
-rwxr-xr-xtest/gnome-mplayer.exp72
-rwxr-xr-xtest/test.sh21
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
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail deluge\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Reading profile /etc/firejail/deluge.profile"
11}
12expect {
13 timeout {puts "TESTING ERROR 1\n";exit}
14 "Child process initialized"
15}
16sleep 10
17
18spawn $env(SHELL)
19send -- "firejail --list\r"
20expect {
21 timeout {puts "TESTING ERROR 3\n";exit}
22 ":firejail"
23}
24expect {
25 timeout {puts "TESTING ERROR 3.1\n";exit}
26 "deluge"
27}
28sleep 1
29
30send -- "firejail --name=blablabla\r"
31expect {
32 timeout {puts "TESTING ERROR 4\n";exit}
33 "Child process initialized"
34}
35sleep 2
36
37spawn $env(SHELL)
38send -- "firemon --seccomp\r"
39expect {
40 timeout {puts "TESTING ERROR 5\n";exit}
41 ":firejail deluge"
42}
43expect {
44 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
45 "Seccomp: 2"
46}
47expect {
48 timeout {puts "TESTING ERROR 5.1\n";exit}
49 "name=blablabla"
50}
51sleep 1
52send -- "firemon --caps\r"
53expect {
54 timeout {puts "TESTING ERROR 6\n";exit}
55 ":firejail deluge"
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
70
71puts "\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
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail gnome-mplayer\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Reading profile /etc/firejail/gnome-mplayer.profile"
11}
12expect {
13 timeout {puts "TESTING ERROR 1\n";exit}
14 "Child process initialized"
15}
16sleep 10
17
18spawn $env(SHELL)
19send -- "firejail --list\r"
20expect {
21 timeout {puts "TESTING ERROR 3\n";exit}
22 ":firejail"
23}
24expect {
25 timeout {puts "TESTING ERROR 3.1\n";exit}
26 "gnome-mplayer"
27}
28sleep 1
29
30send -- "firejail --name=blablabla\r"
31expect {
32 timeout {puts "TESTING ERROR 4\n";exit}
33 "Child process initialized"
34}
35sleep 2
36
37spawn $env(SHELL)
38send -- "firemon --seccomp\r"
39expect {
40 timeout {puts "TESTING ERROR 5\n";exit}
41 ":firejail gnome-mplayer"
42}
43expect {
44 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
45 "Seccomp: 2"
46}
47expect {
48 timeout {puts "TESTING ERROR 5.1\n";exit}
49 "name=blablabla"
50}
51sleep 1
52send -- "firemon --caps\r"
53expect {
54 timeout {puts "TESTING ERROR 6\n";exit}
55 ":firejail gnome-mplayer"
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
70
71puts "\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
228if [ "$?" -eq 0 ]; 228if [ "$?" -eq 0 ];
229then 229then
230 echo "TESTING: fbreader" 230 echo "TESTING: fbreader"
231 ./vlc.exp 231 ./fbreader.exp
232else 232else
233 echo "TESTING: fbreader not found" 233 echo "TESTING: fbreader not found"
234fi 234fi
235 235
236which deluge
237if [ "$?" -eq 0 ];
238then
239 echo "TESTING: deluge"
240 ./deluge.exp
241else
242 echo "TESTING: deluge not found"
243fi
244
245which gnome-mplayer
246if [ "$?" -eq 0 ];
247then
248 echo "TESTING: gnome-mplayer"
249 ./gnome-mplayer.exp
250else
251 echo "TESTING: gnome-mplayer not found"
252fi
253
254
236 255
237 256
238 257