diff options
author | netblue30 <netblue30@yahoo.com> | 2017-10-11 09:27:12 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2017-10-11 09:27:12 -0400 |
commit | 6136e5397c182bfede2db5cd7cb1e50262a247ff (patch) | |
tree | 528466b83c99217a1063e9bc4b1f27411f2e830f /test | |
parent | --build fixes and compile cleanup (diff) | |
download | firejail-6136e5397c182bfede2db5cd7cb1e50262a247ff.tar.gz firejail-6136e5397c182bfede2db5cd7cb1e50262a247ff.tar.zst firejail-6136e5397c182bfede2db5cd7cb1e50262a247ff.zip |
testing
Diffstat (limited to 'test')
-rwxr-xr-x | test/apps/apps.sh | 183 | ||||
-rwxr-xr-x | test/apps/evince.exp | 83 | ||||
-rwxr-xr-x | test/apps/hexchat.exp | 83 | ||||
-rwxr-xr-x | test/apps/kcalc.exp (renamed from test/private-lib/kcalc.exp) | 0 | ||||
-rwxr-xr-x | test/apps/ktorrent.exp (renamed from test/private-lib/ktorrent.exp) | 0 | ||||
-rwxr-xr-x | test/apps/transmission-gtk.exp | 78 | ||||
-rwxr-xr-x | test/private-lib/private-lib.sh | 1 | ||||
-rwxr-xr-x | test/private-lib/qbittorrent.exp | 83 | ||||
-rwxr-xr-x | test/private-lib/transmission-qt.exp | 83 |
9 files changed, 13 insertions, 581 deletions
diff --git a/test/apps/apps.sh b/test/apps/apps.sh index 86b7f636e..efdc48cd1 100755 --- a/test/apps/apps.sh +++ b/test/apps/apps.sh | |||
@@ -6,174 +6,17 @@ | |||
6 | export MALLOC_CHECK_=3 | 6 | export MALLOC_CHECK_=3 |
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | 7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) |
8 | 8 | ||
9 | which firefox | 9 | LIST="firefox midori chromium opera transmission-qt qbittorrent uget-gtk filezilla gthumb thunderbird " |
10 | if [ "$?" -eq 0 ]; | 10 | LIST+="vlc fbreader deluge gnome-mplayer xchat wine" |
11 | then | 11 | |
12 | echo "TESTING: firefox" | 12 | for app in $LIST; do |
13 | ./firefox.exp | 13 | which $app |
14 | else | 14 | if [ "$?" -eq 0 ]; |
15 | echo "TESTING SKIP: firefox not found" | 15 | then |
16 | fi | 16 | echo "TESTING: $app" |
17 | ./$app.exp | ||
18 | else | ||
19 | echo "TESTING SKIP: $app not found" | ||
20 | fi | ||
21 | done | ||
17 | 22 | ||
18 | which midori | ||
19 | if [ "$?" -eq 0 ]; | ||
20 | then | ||
21 | echo "TESTING: midori" | ||
22 | ./midori.exp | ||
23 | else | ||
24 | echo "TESTING SKIP: midori not found" | ||
25 | fi | ||
26 | |||
27 | which chromium | ||
28 | if [ "$?" -eq 0 ]; | ||
29 | then | ||
30 | echo "TESTING: chromium" | ||
31 | ./chromium.exp | ||
32 | else | ||
33 | echo "TESTING SKIP: chromium not found" | ||
34 | fi | ||
35 | |||
36 | which opera | ||
37 | if [ "$?" -eq 0 ]; | ||
38 | then | ||
39 | echo "TESTING: opera" | ||
40 | ./opera.exp | ||
41 | else | ||
42 | echo "TESTING SKIP: opera not found" | ||
43 | fi | ||
44 | |||
45 | which transmission-gtk | ||
46 | if [ "$?" -eq 0 ]; | ||
47 | then | ||
48 | echo "TESTING: transmission-gtk" | ||
49 | ./transmission-gtk.exp | ||
50 | else | ||
51 | echo "TESTING SKIP: transmission-gtk not found" | ||
52 | fi | ||
53 | |||
54 | which transmission-qt | ||
55 | if [ "$?" -eq 0 ]; | ||
56 | then | ||
57 | echo "TESTING: transmission-qt" | ||
58 | ./transmission-qt.exp | ||
59 | else | ||
60 | echo "TESTING SKIP: transmission-qt not found" | ||
61 | fi | ||
62 | |||
63 | which qbittorrent | ||
64 | if [ "$?" -eq 0 ]; | ||
65 | then | ||
66 | echo "TESTING: qbittorrent" | ||
67 | ./qbittorrent.exp | ||
68 | else | ||
69 | echo "TESTING SKIP: qbittorrent not found" | ||
70 | fi | ||
71 | |||
72 | which uget-gtk | ||
73 | if [ "$?" -eq 0 ]; | ||
74 | then | ||
75 | echo "TESTING: uget" | ||
76 | ./uget-gtk.exp | ||
77 | else | ||
78 | echo "TESTING SKIP: uget-gtk not found" | ||
79 | fi | ||
80 | |||
81 | which filezilla | ||
82 | if [ "$?" -eq 0 ]; | ||
83 | then | ||
84 | echo "TESTING: filezilla" | ||
85 | ./filezilla.exp | ||
86 | else | ||
87 | echo "TESTING SKIP: filezilla not found" | ||
88 | fi | ||
89 | |||
90 | which evince | ||
91 | if [ "$?" -eq 0 ]; | ||
92 | then | ||
93 | echo "TESTING: evince" | ||
94 | ./evince.exp | ||
95 | else | ||
96 | echo "TESTING SKIP: evince not found" | ||
97 | fi | ||
98 | |||
99 | |||
100 | which gthumb | ||
101 | if [ "$?" -eq 0 ]; | ||
102 | then | ||
103 | echo "TESTING: gthumb" | ||
104 | ./gthumb.exp | ||
105 | else | ||
106 | echo "TESTING SKIP: gthumb not found" | ||
107 | fi | ||
108 | |||
109 | which thunderbird | ||
110 | if [ "$?" -eq 0 ]; | ||
111 | then | ||
112 | echo "TESTING: thunderbird" | ||
113 | ./thunderbird.exp | ||
114 | else | ||
115 | echo "TESTING SKIP: thunderbird not found" | ||
116 | fi | ||
117 | |||
118 | which vlc | ||
119 | if [ "$?" -eq 0 ]; | ||
120 | then | ||
121 | echo "TESTING: vlc" | ||
122 | ./vlc.exp | ||
123 | else | ||
124 | echo "TESTING SKIP: vlc not found" | ||
125 | fi | ||
126 | |||
127 | which fbreader | ||
128 | if [ "$?" -eq 0 ]; | ||
129 | then | ||
130 | echo "TESTING: fbreader" | ||
131 | ./fbreader.exp | ||
132 | else | ||
133 | echo "TESTING SKIP: fbreader not found" | ||
134 | fi | ||
135 | |||
136 | which deluge | ||
137 | if [ "$?" -eq 0 ]; | ||
138 | then | ||
139 | echo "TESTING: deluge" | ||
140 | ./deluge.exp | ||
141 | else | ||
142 | echo "TESTING SKIP: deluge not found" | ||
143 | fi | ||
144 | |||
145 | which gnome-mplayer | ||
146 | if [ "$?" -eq 0 ]; | ||
147 | then | ||
148 | echo "TESTING: gnome-mplayer" | ||
149 | ./gnome-mplayer.exp | ||
150 | else | ||
151 | echo "TESTING SKIP: gnome-mplayer not found" | ||
152 | fi | ||
153 | |||
154 | which xchat | ||
155 | if [ "$?" -eq 0 ]; | ||
156 | then | ||
157 | echo "TESTING: xchat" | ||
158 | ./xchat.exp | ||
159 | else | ||
160 | echo "TESTING SKIP: xchat not found" | ||
161 | fi | ||
162 | |||
163 | which hexchat | ||
164 | if [ "$?" -eq 0 ]; | ||
165 | then | ||
166 | echo "TESTING: hexchat" | ||
167 | ./hexchat.exp | ||
168 | else | ||
169 | echo "TESTING SKIP: hexchat not found" | ||
170 | fi | ||
171 | |||
172 | which wine | ||
173 | if [ "$?" -eq 0 ]; | ||
174 | then | ||
175 | echo "TESTING: wine" | ||
176 | ./wine.exp | ||
177 | else | ||
178 | echo "TESTING SKIP: wine not found" | ||
179 | fi | ||
diff --git a/test/apps/evince.exp b/test/apps/evince.exp deleted file mode 100755 index 5eada5fdf..000000000 --- a/test/apps/evince.exp +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2017 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail evince\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "Reading profile /etc/firejail/evince.profile" | ||
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | "Child process initialized" | ||
18 | } | ||
19 | sleep 3 | ||
20 | |||
21 | spawn $env(SHELL) | ||
22 | send -- "firejail --list\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 3\n";exit} | ||
25 | ":firejail" | ||
26 | } | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
29 | "evince" | ||
30 | } | ||
31 | after 100 | ||
32 | |||
33 | # grsecurity exit | ||
34 | send -- "file /proc/sys/kernel/grsecurity\r" | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR - grsecurity detection\n";exit} | ||
37 | "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit} | ||
38 | "cannot open" {puts "grsecurity not present\n"} | ||
39 | } | ||
40 | |||
41 | send -- "firejail --name=blablabla\r" | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 4\n";exit} | ||
44 | "Child process initialized" | ||
45 | } | ||
46 | sleep 2 | ||
47 | |||
48 | spawn $env(SHELL) | ||
49 | send -- "firemon --seccomp\r" | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 5\n";exit} | ||
52 | "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} | ||
53 | ":firejail evince" | ||
54 | } | ||
55 | expect { | ||
56 | timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} | ||
57 | "Seccomp: 2" | ||
58 | } | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
61 | "name=blablabla" | ||
62 | } | ||
63 | after 100 | ||
64 | send -- "firemon --caps\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 6\n";exit} | ||
67 | ":firejail evince" | ||
68 | } | ||
69 | expect { | ||
70 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
71 | "CapBnd:" | ||
72 | } | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
75 | "0000000000000000" | ||
76 | } | ||
77 | expect { | ||
78 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
79 | "name=blablabla" | ||
80 | } | ||
81 | after 100 | ||
82 | |||
83 | puts "\nall done\n" | ||
diff --git a/test/apps/hexchat.exp b/test/apps/hexchat.exp deleted file mode 100755 index 9d78a9676..000000000 --- a/test/apps/hexchat.exp +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2017 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail hexchat\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "Reading profile /etc/firejail/hexchat.profile" | ||
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | "Child process initialized" | ||
18 | } | ||
19 | sleep 3 | ||
20 | |||
21 | spawn $env(SHELL) | ||
22 | send -- "firejail --list\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 3\n";exit} | ||
25 | ":firejail" | ||
26 | } | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
29 | "hexchat" | ||
30 | } | ||
31 | after 100 | ||
32 | |||
33 | # grsecurity exit | ||
34 | send -- "file /proc/sys/kernel/grsecurity\r" | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR - grsecurity detection\n";exit} | ||
37 | "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit} | ||
38 | "cannot open" {puts "grsecurity not present\n"} | ||
39 | } | ||
40 | |||
41 | send -- "firejail --name=blablabla\r" | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 4\n";exit} | ||
44 | "Child process initialized" | ||
45 | } | ||
46 | sleep 2 | ||
47 | |||
48 | spawn $env(SHELL) | ||
49 | send -- "firemon --seccomp\r" | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 5\n";exit} | ||
52 | "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} | ||
53 | "hexchat" | ||
54 | } | ||
55 | expect { | ||
56 | timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} | ||
57 | "Seccomp: 2" | ||
58 | } | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
61 | "name=blablabla" | ||
62 | } | ||
63 | after 100 | ||
64 | send -- "firemon --caps\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 6\n";exit} | ||
67 | "hexchat" | ||
68 | } | ||
69 | expect { | ||
70 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
71 | "CapBnd:" | ||
72 | } | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
75 | "0000000000000000" | ||
76 | } | ||
77 | expect { | ||
78 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
79 | "name=blablabla" | ||
80 | } | ||
81 | after 100 | ||
82 | |||
83 | puts "\n" | ||
diff --git a/test/private-lib/kcalc.exp b/test/apps/kcalc.exp index 8158625b4..8158625b4 100755 --- a/test/private-lib/kcalc.exp +++ b/test/apps/kcalc.exp | |||
diff --git a/test/private-lib/ktorrent.exp b/test/apps/ktorrent.exp index cbad352ca..cbad352ca 100755 --- a/test/private-lib/ktorrent.exp +++ b/test/apps/ktorrent.exp | |||
diff --git a/test/apps/transmission-gtk.exp b/test/apps/transmission-gtk.exp deleted file mode 100755 index 4df1f7892..000000000 --- a/test/apps/transmission-gtk.exp +++ /dev/null | |||
@@ -1,78 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2017 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail transmission-gtk\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1\n";exit} | ||
13 | "Child process initialized" | ||
14 | } | ||
15 | sleep 5 | ||
16 | |||
17 | spawn $env(SHELL) | ||
18 | send -- "firejail --list\r" | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 3\n";exit} | ||
21 | ":firejail" | ||
22 | } | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
25 | "transmission-gtk" | ||
26 | } | ||
27 | after 100 | ||
28 | |||
29 | # grsecurity exit | ||
30 | send -- "file /proc/sys/kernel/grsecurity\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR - grsecurity detection\n";exit} | ||
33 | "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit} | ||
34 | "cannot open" {puts "grsecurity not present\n"} | ||
35 | } | ||
36 | send -- "firejail --name=blablabla\r" | ||
37 | expect { | ||
38 | timeout {puts "TESTING ERROR 4\n";exit} | ||
39 | "Child process initialized" | ||
40 | } | ||
41 | sleep 2 | ||
42 | |||
43 | spawn $env(SHELL) | ||
44 | send -- "firemon --seccomp\r" | ||
45 | expect { | ||
46 | timeout {puts "TESTING ERROR 5\n";exit} | ||
47 | "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} | ||
48 | ":firejail transmission-gtk" | ||
49 | } | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} | ||
52 | "Seccomp: 2" | ||
53 | } | ||
54 | expect { | ||
55 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
56 | "name=blablabla" | ||
57 | } | ||
58 | after 100 | ||
59 | send -- "firemon --caps\r" | ||
60 | expect { | ||
61 | timeout {puts "TESTING ERROR 6\n";exit} | ||
62 | ":firejail transmission-gtk" | ||
63 | } | ||
64 | expect { | ||
65 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
66 | "CapBnd" | ||
67 | } | ||
68 | expect { | ||
69 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
70 | "0000000000000000" | ||
71 | } | ||
72 | expect { | ||
73 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
74 | "name=blablabla" | ||
75 | } | ||
76 | after 100 | ||
77 | |||
78 | puts "\nall done\n" | ||
diff --git a/test/private-lib/private-lib.sh b/test/private-lib/private-lib.sh index 5718d33d7..813c76b42 100755 --- a/test/private-lib/private-lib.sh +++ b/test/private-lib/private-lib.sh | |||
@@ -5,7 +5,6 @@ | |||
5 | 5 | ||
6 | export MALLOC_CHECK_=3 | 6 | export MALLOC_CHECK_=3 |
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | 7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) |
8 | # LIST="evince galculator gnome-calculator hexchat kcalc ktorrent leafpad mousepad qbittorrent transmission-gtk transmission-qt xcalc" | ||
9 | LIST="evince galculator gnome-calculator hexchat leafpad mousepad transmission-gtk xcalc" | 8 | LIST="evince galculator gnome-calculator hexchat leafpad mousepad transmission-gtk xcalc" |
10 | 9 | ||
11 | 10 | ||
diff --git a/test/private-lib/qbittorrent.exp b/test/private-lib/qbittorrent.exp deleted file mode 100755 index ef7e996df..000000000 --- a/test/private-lib/qbittorrent.exp +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2017 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail qbittorrent\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "Reading profile /etc/firejail/qbittorrent.profile" | ||
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | "Child process initialized" | ||
18 | } | ||
19 | sleep 3 | ||
20 | |||
21 | spawn $env(SHELL) | ||
22 | send -- "firejail --list\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 3\n";exit} | ||
25 | ":firejail" | ||
26 | } | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
29 | "qbittorrent" | ||
30 | } | ||
31 | after 100 | ||
32 | |||
33 | # grsecurity exit | ||
34 | send -- "file /proc/sys/kernel/grsecurity\r" | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR - grsecurity detection\n";exit} | ||
37 | "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit} | ||
38 | "cannot open" {puts "grsecurity not present\n"} | ||
39 | } | ||
40 | |||
41 | send -- "firejail --name=blablabla\r" | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 4\n";exit} | ||
44 | "Child process initialized" | ||
45 | } | ||
46 | sleep 2 | ||
47 | |||
48 | spawn $env(SHELL) | ||
49 | send -- "firemon --seccomp\r" | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 5\n";exit} | ||
52 | "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} | ||
53 | ":firejail qbittorrent" | ||
54 | } | ||
55 | expect { | ||
56 | timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} | ||
57 | "Seccomp: 2" | ||
58 | } | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
61 | "name=blablabla" | ||
62 | } | ||
63 | after 100 | ||
64 | send -- "firemon --caps\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 6\n";exit} | ||
67 | ":firejail qbittorrent" | ||
68 | } | ||
69 | expect { | ||
70 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
71 | "CapBnd:" | ||
72 | } | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
75 | "0000000000000000" | ||
76 | } | ||
77 | expect { | ||
78 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
79 | "name=blablabla" | ||
80 | } | ||
81 | after 100 | ||
82 | |||
83 | puts "\nall done\n" | ||
diff --git a/test/private-lib/transmission-qt.exp b/test/private-lib/transmission-qt.exp deleted file mode 100755 index db19a0700..000000000 --- a/test/private-lib/transmission-qt.exp +++ /dev/null | |||
@@ -1,83 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2017 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail transmission-qt\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0\n";exit} | ||
13 | "Reading profile /etc/firejail/transmission-qt.profile" | ||
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | "Child process initialized" | ||
18 | } | ||
19 | sleep 3 | ||
20 | |||
21 | spawn $env(SHELL) | ||
22 | send -- "firejail --list\r" | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 3\n";exit} | ||
25 | ":firejail" | ||
26 | } | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
29 | "transmission-qt" | ||
30 | } | ||
31 | after 100 | ||
32 | |||
33 | # grsecurity exit | ||
34 | send -- "file /proc/sys/kernel/grsecurity\r" | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR - grsecurity detection\n";exit} | ||
37 | "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit} | ||
38 | "cannot open" {puts "grsecurity not present\n"} | ||
39 | } | ||
40 | |||
41 | send -- "firejail --name=blablabla\r" | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 4\n";exit} | ||
44 | "Child process initialized" | ||
45 | } | ||
46 | sleep 2 | ||
47 | |||
48 | spawn $env(SHELL) | ||
49 | send -- "firemon --seccomp\r" | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 5\n";exit} | ||
52 | "need to be root" {puts "/proc mounted as hidepid, exiting...\n"; exit} | ||
53 | ":firejail transmission-qt" | ||
54 | } | ||
55 | expect { | ||
56 | timeout {puts "TESTING ERROR 5.1 (seccomp)\n";exit} | ||
57 | "Seccomp: 2" | ||
58 | } | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
61 | "name=blablabla" | ||
62 | } | ||
63 | after 100 | ||
64 | send -- "firemon --caps\r" | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 6\n";exit} | ||
67 | ":firejail transmission-qt" | ||
68 | } | ||
69 | expect { | ||
70 | timeout {puts "TESTING ERROR 6.1\n";exit} | ||
71 | "CapBnd:" | ||
72 | } | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 6.2\n";exit} | ||
75 | "0000000000000000" | ||
76 | } | ||
77 | expect { | ||
78 | timeout {puts "TESTING ERROR 6.3\n";exit} | ||
79 | "name=blablabla" | ||
80 | } | ||
81 | after 100 | ||
82 | |||
83 | puts "\nall done\n" | ||