aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-10-15 12:38:58 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2015-10-15 12:38:58 -0400
commit84b984b7d1925bd937606e18e0605d7517f5f686 (patch)
tree9e0ace227d8375cd5c73775f62a3a3313fa83cf8
parentnew syscalls added to default seccomp filter (diff)
downloadfirejail-84b984b7d1925bd937606e18e0605d7517f5f686.tar.gz
firejail-84b984b7d1925bd937606e18e0605d7517f5f686.tar.zst
firejail-84b984b7d1925bd937606e18e0605d7517f5f686.zip
testing
-rwxr-xr-xtest/fbreader.exp72
-rwxr-xr-xtest/icedove.exp72
-rwxr-xr-xtest/test.sh30
-rwxr-xr-xtest/vlc.exp72
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
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail fbreader\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Reading profile /etc/firejail/fbreader.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 "fbreader"
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 fbreader"
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 fbreader"
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 "\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
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail icedove\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Reading profile /etc/firejail/icedove.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 "icedove"
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 icedove"
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 icedove"
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 "\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"
207fi 207fi
208 208
209which icedove
210if [ "$?" -eq 0 ];
211then
212 echo "TESTING: icedove"
213 ./icedove.exp
214else
215 echo "TESTING: icedove not found"
216fi
217
218which vlc
219if [ "$?" -eq 0 ];
220then
221 echo "TESTING: vlc"
222 ./vlc.exp
223else
224 echo "TESTING: vlc not found"
225fi
226
227which fbreader
228if [ "$?" -eq 0 ];
229then
230 echo "TESTING: fbreader"
231 ./vlc.exp
232else
233 echo "TESTING: fbreader not found"
234fi
235
236
237
238
209echo "TESTING: PID" 239echo "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
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail vlc\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Reading profile /etc/firejail/vlc.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 "vlc"
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 vlc"
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 vlc"
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 "\nall done\n"
72