aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-11-28 07:37:32 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2015-11-28 07:37:32 -0500
commit2b8b8e54968d068599d5800f88869efcadd316ac (patch)
tree692c29ee317a72c9c9a4bb11101084ca910bb651 /test
parentweechat profile integration (diff)
downloadfirejail-2b8b8e54968d068599d5800f88869efcadd316ac.tar.gz
firejail-2b8b8e54968d068599d5800f88869efcadd316ac.tar.zst
firejail-2b8b8e54968d068599d5800f88869efcadd316ac.zip
profile cleanup, addinghexchat profile
Diffstat (limited to 'test')
-rwxr-xr-xtest/evince.exp2
-rwxr-xr-xtest/fbreader.exp2
-rwxr-xr-xtest/hexchat.exp71
-rwxr-xr-xtest/test.sh35
-rwxr-xr-xtest/vlc.exp2
-rwxr-xr-xtest/weechat.exp71
-rwxr-xr-xtest/wine.exp30
-rwxr-xr-xtest/xchat.exp71
8 files changed, 281 insertions, 3 deletions
diff --git a/test/evince.exp b/test/evince.exp
index 7b115144c..ba6ca1b6d 100755
--- a/test/evince.exp
+++ b/test/evince.exp
@@ -13,7 +13,7 @@ expect {
13 timeout {puts "TESTING ERROR 1\n";exit} 13 timeout {puts "TESTING ERROR 1\n";exit}
14 "Child process initialized" 14 "Child process initialized"
15} 15}
16sleep 10 16sleep 3
17 17
18spawn $env(SHELL) 18spawn $env(SHELL)
19send -- "firejail --list\r" 19send -- "firejail --list\r"
diff --git a/test/fbreader.exp b/test/fbreader.exp
index 546710b97..a4df50932 100755
--- a/test/fbreader.exp
+++ b/test/fbreader.exp
@@ -13,7 +13,7 @@ expect {
13 timeout {puts "TESTING ERROR 1\n";exit} 13 timeout {puts "TESTING ERROR 1\n";exit}
14 "Child process initialized" 14 "Child process initialized"
15} 15}
16sleep 10 16sleep 3
17 17
18spawn $env(SHELL) 18spawn $env(SHELL)
19send -- "firejail --list\r" 19send -- "firejail --list\r"
diff --git a/test/hexchat.exp b/test/hexchat.exp
new file mode 100755
index 000000000..0653bcb13
--- /dev/null
+++ b/test/hexchat.exp
@@ -0,0 +1,71 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail hexchat\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Reading profile /etc/firejail/hexchat.profile"
11}
12expect {
13 timeout {puts "TESTING ERROR 1\n";exit}
14 "Child process initialized"
15}
16sleep 3
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 "hexchat"
27}
28sleep 1
29send -- "firejail --name=blablabla\r"
30expect {
31 timeout {puts "TESTING ERROR 4\n";exit}
32 "Child process initialized"
33}
34sleep 2
35
36spawn $env(SHELL)
37send -- "firemon --seccomp\r"
38expect {
39 timeout {puts "TESTING ERROR 5\n";exit}
40 "hexchat"
41}
42expect {
43 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
44 "Seccomp: 2"
45}
46expect {
47 timeout {puts "TESTING ERROR 5.1\n";exit}
48 "name=blablabla"
49}
50sleep 1
51send -- "firemon --caps\r"
52expect {
53 timeout {puts "TESTING ERROR 6\n";exit}
54 "hexchat"
55}
56expect {
57 timeout {puts "TESTING ERROR 6.1\n";exit}
58 "CapBnd:"
59}
60expect {
61 timeout {puts "TESTING ERROR 6.2\n";exit}
62 "0000000000000000"
63}
64expect {
65 timeout {puts "TESTING ERROR 6.3\n";exit}
66 "name=blablabla"
67}
68sleep 1
69
70puts "\n"
71
diff --git a/test/test.sh b/test/test.sh
index fdb1f8ed7..aaae2a981 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -260,6 +260,41 @@ else
260 echo "TESTING: gnome-mplayer not found" 260 echo "TESTING: gnome-mplayer not found"
261fi 261fi
262 262
263which xchat
264if [ "$?" -eq 0 ];
265then
266 echo "TESTING: xchat"
267 ./xchat.exp
268else
269 echo "TESTING: xchat not found"
270fi
271
272which hexchat
273if [ "$?" -eq 0 ];
274then
275 echo "TESTING: hexchat"
276 ./hexchat.exp
277else
278 echo "TESTING: hexchat not found"
279fi
280
281which weechat-curses
282if [ "$?" -eq 0 ];
283then
284 echo "TESTING: weechat"
285 ./weechat.exp
286else
287 echo "TESTING: weechat not found"
288fi
289
290#which wine
291#if [ "$?" -eq 0 ];
292#then
293# echo "TESTING: wine"
294# ./wine.exp
295#else
296# echo "TESTING: wine not found"
297#fi
263 298
264 299
265 300
diff --git a/test/vlc.exp b/test/vlc.exp
index 8ab5aa2ce..53d25c9dd 100755
--- a/test/vlc.exp
+++ b/test/vlc.exp
@@ -13,7 +13,7 @@ expect {
13 timeout {puts "TESTING ERROR 1\n";exit} 13 timeout {puts "TESTING ERROR 1\n";exit}
14 "Child process initialized" 14 "Child process initialized"
15} 15}
16sleep 10 16sleep 3
17 17
18spawn $env(SHELL) 18spawn $env(SHELL)
19send -- "firejail --list\r" 19send -- "firejail --list\r"
diff --git a/test/weechat.exp b/test/weechat.exp
new file mode 100755
index 000000000..ac2430280
--- /dev/null
+++ b/test/weechat.exp
@@ -0,0 +1,71 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail weechat-curses\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Reading profile /etc/firejail/weechat.profile"
11}
12expect {
13 timeout {puts "TESTING ERROR 1\n";exit}
14 "Child process initialized"
15}
16sleep 3
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 "weechat-curses"
27}
28sleep 1
29send -- "firejail --name=blablabla\r"
30expect {
31 timeout {puts "TESTING ERROR 4\n";exit}
32 "Child process initialized"
33}
34sleep 2
35
36spawn $env(SHELL)
37send -- "firemon --seccomp\r"
38expect {
39 timeout {puts "TESTING ERROR 5\n";exit}
40 "weechat-curses"
41}
42expect {
43 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
44 "Seccomp: 2"
45}
46expect {
47 timeout {puts "TESTING ERROR 5.1\n";exit}
48 "name=blablabla"
49}
50sleep 1
51send -- "firemon --caps\r"
52expect {
53 timeout {puts "TESTING ERROR 6\n";exit}
54 "weechat-curses"
55}
56expect {
57 timeout {puts "TESTING ERROR 6.1\n";exit}
58 "CapBnd:"
59}
60expect {
61 timeout {puts "TESTING ERROR 6.2\n";exit}
62 "0000000000000000"
63}
64expect {
65 timeout {puts "TESTING ERROR 6.3\n";exit}
66 "name=blablabla"
67}
68sleep 1
69
70puts "\n"
71
diff --git a/test/wine.exp b/test/wine.exp
new file mode 100755
index 000000000..d87c1f205
--- /dev/null
+++ b/test/wine.exp
@@ -0,0 +1,30 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail wine --help\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Reading profile /etc/firejail/wine.profile"
11}
12expect {
13 timeout {puts "TESTING ERROR 1\n";exit}
14 "Child process initialized"
15}
16expect {
17 timeout {puts "TESTING ERROR 2\n";exit}
18 "Usage: wine PROGRAM"
19}
20expect {
21 timeout {puts "TESTING ERROR 3\n";exit}
22 "wine --version"
23}
24expect {
25 timeout {puts "TESTING ERROR 4\n";exit}
26 "parent is shutting down, bye..."
27}
28
29puts "\nall done\n"
30
diff --git a/test/xchat.exp b/test/xchat.exp
new file mode 100755
index 000000000..babbcf87d
--- /dev/null
+++ b/test/xchat.exp
@@ -0,0 +1,71 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail xchat\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Reading profile /etc/firejail/xchat.profile"
11}
12expect {
13 timeout {puts "TESTING ERROR 1\n";exit}
14 "Child process initialized"
15}
16sleep 3
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 "xchat"
27}
28sleep 1
29send -- "firejail --name=blablabla\r"
30expect {
31 timeout {puts "TESTING ERROR 4\n";exit}
32 "Child process initialized"
33}
34sleep 2
35
36spawn $env(SHELL)
37send -- "firemon --seccomp\r"
38expect {
39 timeout {puts "TESTING ERROR 5\n";exit}
40 " xchat"
41}
42expect {
43 timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit}
44 "Seccomp: 2"
45}
46expect {
47 timeout {puts "TESTING ERROR 5.1\n";exit}
48 "name=blablabla"
49}
50sleep 1
51send -- "firemon --caps\r"
52expect {
53 timeout {puts "TESTING ERROR 6\n";exit}
54 " xchat"
55}
56expect {
57 timeout {puts "TESTING ERROR 6.1\n";exit}
58 "CapBnd:"
59}
60expect {
61 timeout {puts "TESTING ERROR 6.2\n";exit}
62 "0000000000000000"
63}
64expect {
65 timeout {puts "TESTING ERROR 6.3\n";exit}
66 "name=blablabla"
67}
68sleep 1
69
70puts "\n"
71