diff options
author | 2018-09-28 06:51:39 -0400 | |
---|---|---|
committer | 2018-09-28 06:51:39 -0400 | |
commit | 263ac00775597a0bb2aaf4fc6e11df8151262797 (patch) | |
tree | 5a0e5ea7a5ffab2acfe25af33517e96dea1ee3e2 /test | |
parent | fixed test-arguments (diff) | |
download | firejail-263ac00775597a0bb2aaf4fc6e11df8151262797.tar.gz firejail-263ac00775597a0bb2aaf4fc6e11df8151262797.tar.zst firejail-263ac00775597a0bb2aaf4fc6e11df8151262797.zip |
fixed some tests
Diffstat (limited to 'test')
-rwxr-xr-x | test/compile/compile.sh | 165 | ||||
-rwxr-xr-x | test/utils/fs-print.exp | 3 |
2 files changed, 33 insertions, 135 deletions
diff --git a/test/compile/compile.sh b/test/compile/compile.sh index 9d35bbcde..cbe76a242 100755 --- a/test/compile/compile.sh +++ b/test/compile/compile.sh | |||
@@ -2,19 +2,13 @@ | |||
2 | 2 | ||
3 | arr[1]="TEST 1: standard compilation" | 3 | arr[1]="TEST 1: standard compilation" |
4 | arr[2]="TEST 2: compile seccomp disabled" | 4 | arr[2]="TEST 2: compile seccomp disabled" |
5 | arr[3]="TEST 3: compile chroot disabled" | 5 | arr[3]="TEST 3: compile user namespace disabled" |
6 | arr[4]="TEST 4: compile bind disabled" | 6 | arr[4]="TEST 4: compile network disabled" |
7 | arr[5]="TEST 5: compile user namespace disabled" | 7 | arr[5]="TEST 5: compile disable whitelist" |
8 | arr[6]="TEST 6: compile network disabled" | 8 | arr[6]="TEST 6: compile disable global config" |
9 | arr[7]="TEST 7: compile X11 disabled" | 9 | arr[7]="TEST 7: compile apparmor" |
10 | arr[8]="deprecated: TEST 8: compile network restricted" | 10 | arr[8]="TEST 8: compile busybox" |
11 | arr[9]="TEST 9: compile file transfer disabled" | 11 | arr[9]="TEST 9: compile apparmor enabled" |
12 | arr[10]="TEST 10: compile disable whitelist" | ||
13 | arr[11]="TEST 11: compile disable global config" | ||
14 | arr[12]="TEST 12: compile apparmor" | ||
15 | arr[13]="TEST 13: compile busybox" | ||
16 | arr[14]="TEST 14: compile overlayfs disabled" | ||
17 | arr[15]="TEST 15: compile apparmor enabled" | ||
18 | 12 | ||
19 | # remove previous reports and output file | 13 | # remove previous reports and output file |
20 | cleanup() { | 14 | cleanup() { |
@@ -92,13 +86,13 @@ rm output-configure output-make | |||
92 | #***************************************************************** | 86 | #***************************************************************** |
93 | # TEST 3 | 87 | # TEST 3 |
94 | #***************************************************************** | 88 | #***************************************************************** |
95 | # - disable chroot configuration | 89 | # - disable user namespace configuration |
96 | #***************************************************************** | 90 | #***************************************************************** |
97 | print_title "${arr[3]}" | 91 | print_title "${arr[3]}" |
98 | # seccomp | 92 | # seccomp |
99 | cd firejail | 93 | cd firejail |
100 | make distclean | 94 | make distclean |
101 | ./configure --prefix=/usr --disable-chroot --enable-fatal-warnings 2>&1 | tee ../output-configure | 95 | ./configure --prefix=/usr --disable-userns --enable-fatal-warnings 2>&1 | tee ../output-configure |
102 | make -j4 2>&1 | tee ../output-make | 96 | make -j4 2>&1 | tee ../output-make |
103 | cd .. | 97 | cd .. |
104 | grep Warning output-configure output-make > ./report-test3 | 98 | grep Warning output-configure output-make > ./report-test3 |
@@ -110,13 +104,13 @@ rm output-configure output-make | |||
110 | #***************************************************************** | 104 | #***************************************************************** |
111 | # TEST 4 | 105 | # TEST 4 |
112 | #***************************************************************** | 106 | #***************************************************************** |
113 | # - disable bind configuration | 107 | # - disable networking |
114 | #***************************************************************** | 108 | #***************************************************************** |
115 | print_title "${arr[4]}" | 109 | print_title "${arr[4]}" |
116 | # seccomp | 110 | # seccomp |
117 | cd firejail | 111 | cd firejail |
118 | make distclean | 112 | make distclean |
119 | ./configure --prefix=/usr --disable-bind --enable-fatal-warnings 2>&1 | tee ../output-configure | 113 | ./configure --prefix=/usr --disable-network --enable-fatal-warnings 2>&1 | tee ../output-configure |
120 | make -j4 2>&1 | tee ../output-make | 114 | make -j4 2>&1 | tee ../output-make |
121 | cd .. | 115 | cd .. |
122 | grep Warning output-configure output-make > ./report-test4 | 116 | grep Warning output-configure output-make > ./report-test4 |
@@ -125,16 +119,17 @@ cp output-configure oc4 | |||
125 | cp output-make om4 | 119 | cp output-make om4 |
126 | rm output-configure output-make | 120 | rm output-configure output-make |
127 | 121 | ||
122 | |||
128 | #***************************************************************** | 123 | #***************************************************************** |
129 | # TEST 5 | 124 | # TEST 5 |
130 | #***************************************************************** | 125 | #***************************************************************** |
131 | # - disable user namespace configuration | 126 | # - disable whitelist |
132 | #***************************************************************** | 127 | #***************************************************************** |
133 | print_title "${arr[5]}" | 128 | print_title "${arr[10]}" |
134 | # seccomp | 129 | # seccomp |
135 | cd firejail | 130 | cd firejail |
136 | make distclean | 131 | make distclean |
137 | ./configure --prefix=/usr --disable-userns --enable-fatal-warnings 2>&1 | tee ../output-configure | 132 | ./configure --prefix=/usr --disable-whitelist --enable-fatal-warnings 2>&1 | tee ../output-configure |
138 | make -j4 2>&1 | tee ../output-make | 133 | make -j4 2>&1 | tee ../output-make |
139 | cd .. | 134 | cd .. |
140 | grep Warning output-configure output-make > ./report-test5 | 135 | grep Warning output-configure output-make > ./report-test5 |
@@ -146,14 +141,13 @@ rm output-configure output-make | |||
146 | #***************************************************************** | 141 | #***************************************************************** |
147 | # TEST 6 | 142 | # TEST 6 |
148 | #***************************************************************** | 143 | #***************************************************************** |
149 | # - disable user namespace configuration | 144 | # - disable global config |
150 | # - check compilation | ||
151 | #***************************************************************** | 145 | #***************************************************************** |
152 | print_title "${arr[6]}" | 146 | print_title "${arr[6]}" |
153 | # seccomp | 147 | # seccomp |
154 | cd firejail | 148 | cd firejail |
155 | make distclean | 149 | make distclean |
156 | ./configure --prefix=/usr --disable-network --enable-fatal-warnings 2>&1 | tee ../output-configure | 150 | ./configure --prefix=/usr --disable-globalcfg --enable-fatal-warnings 2>&1 | tee ../output-configure |
157 | make -j4 2>&1 | tee ../output-make | 151 | make -j4 2>&1 | tee ../output-make |
158 | cd .. | 152 | cd .. |
159 | grep Warning output-configure output-make > ./report-test6 | 153 | grep Warning output-configure output-make > ./report-test6 |
@@ -165,13 +159,13 @@ rm output-configure output-make | |||
165 | #***************************************************************** | 159 | #***************************************************************** |
166 | # TEST 7 | 160 | # TEST 7 |
167 | #***************************************************************** | 161 | #***************************************************************** |
168 | # - disable X11 support | 162 | # - enable apparmor |
169 | #***************************************************************** | 163 | #***************************************************************** |
170 | print_title "${arr[7]}" | 164 | print_title "${arr[7]}" |
171 | # seccomp | 165 | # seccomp |
172 | cd firejail | 166 | cd firejail |
173 | make distclean | 167 | make distclean |
174 | ./configure --prefix=/usr --disable-x11 --enable-fatal-warnings 2>&1 | tee ../output-configure | 168 | ./configure --prefix=/usr --enable-apparmor --enable-fatal-warnings 2>&1 | tee ../output-configure |
175 | make -j4 2>&1 | tee ../output-make | 169 | make -j4 2>&1 | tee ../output-make |
176 | cd .. | 170 | cd .. |
177 | grep Warning output-configure output-make > ./report-test7 | 171 | grep Warning output-configure output-make > ./report-test7 |
@@ -180,131 +174,40 @@ cp output-configure oc7 | |||
180 | cp output-make om7 | 174 | cp output-make om7 |
181 | rm output-configure output-make | 175 | rm output-configure output-make |
182 | 176 | ||
183 | |||
184 | #***************************************************************** | 177 | #***************************************************************** |
185 | # TEST 9 | 178 | # TEST 8 |
186 | #***************************************************************** | ||
187 | # - disable file transfer | ||
188 | #***************************************************************** | ||
189 | print_title "${arr[9]}" | ||
190 | # seccomp | ||
191 | cd firejail | ||
192 | make distclean | ||
193 | ./configure --prefix=/usr --disable-file-transfer --enable-fatal-warnings 2>&1 | tee ../output-configure | ||
194 | make -j4 2>&1 | tee ../output-make | ||
195 | cd .. | ||
196 | grep Warning output-configure output-make > ./report-test9 | ||
197 | grep Error output-configure output-make >> ./report-test9 | ||
198 | cp output-configure oc9 | ||
199 | cp output-make om9 | ||
200 | rm output-configure output-make | ||
201 | |||
202 | #***************************************************************** | ||
203 | # TEST 10 | ||
204 | #***************************************************************** | ||
205 | # - disable whitelist | ||
206 | #***************************************************************** | ||
207 | print_title "${arr[10]}" | ||
208 | # seccomp | ||
209 | cd firejail | ||
210 | make distclean | ||
211 | ./configure --prefix=/usr --disable-whitelist --enable-fatal-warnings 2>&1 | tee ../output-configure | ||
212 | make -j4 2>&1 | tee ../output-make | ||
213 | cd .. | ||
214 | grep Warning output-configure output-make > ./report-test10 | ||
215 | grep Error output-configure output-make >> ./report-test10 | ||
216 | cp output-configure oc10 | ||
217 | cp output-make om10 | ||
218 | rm output-configure output-make | ||
219 | |||
220 | #***************************************************************** | ||
221 | # TEST 11 | ||
222 | #***************************************************************** | ||
223 | # - disable global config | ||
224 | #***************************************************************** | ||
225 | print_title "${arr[11]}" | ||
226 | # seccomp | ||
227 | cd firejail | ||
228 | make distclean | ||
229 | ./configure --prefix=/usr --disable-globalcfg --enable-fatal-warnings 2>&1 | tee ../output-configure | ||
230 | make -j4 2>&1 | tee ../output-make | ||
231 | cd .. | ||
232 | grep Warning output-configure output-make > ./report-test11 | ||
233 | grep Error output-configure output-make >> ./report-test11 | ||
234 | cp output-configure oc11 | ||
235 | cp output-make om11 | ||
236 | rm output-configure output-make | ||
237 | |||
238 | #***************************************************************** | ||
239 | # TEST 12 | ||
240 | #***************************************************************** | ||
241 | # - enable apparmor | ||
242 | #***************************************************************** | ||
243 | print_title "${arr[12]}" | ||
244 | # seccomp | ||
245 | cd firejail | ||
246 | make distclean | ||
247 | ./configure --prefix=/usr --enable-apparmor --enable-fatal-warnings 2>&1 | tee ../output-configure | ||
248 | make -j4 2>&1 | tee ../output-make | ||
249 | cd .. | ||
250 | grep Warning output-configure output-make > ./report-test12 | ||
251 | grep Error output-configure output-make >> ./report-test12 | ||
252 | cp output-configure oc12 | ||
253 | cp output-make om12 | ||
254 | rm output-configure output-make | ||
255 | |||
256 | #***************************************************************** | ||
257 | # TEST 13 | ||
258 | #***************************************************************** | 179 | #***************************************************************** |
259 | # - enable busybox workaround | 180 | # - enable busybox workaround |
260 | #***************************************************************** | 181 | #***************************************************************** |
261 | print_title "${arr[13]}" | 182 | print_title "${arr[8]}" |
262 | # seccomp | 183 | # seccomp |
263 | cd firejail | 184 | cd firejail |
264 | make distclean | 185 | make distclean |
265 | ./configure --prefix=/usr --enable-busybox-workaround --enable-fatal-warnings 2>&1 | tee ../output-configure | 186 | ./configure --prefix=/usr --enable-busybox-workaround --enable-fatal-warnings 2>&1 | tee ../output-configure |
266 | make -j4 2>&1 | tee ../output-make | 187 | make -j4 2>&1 | tee ../output-make |
267 | cd .. | 188 | cd .. |
268 | grep Warning output-configure output-make > ./report-test13 | 189 | grep Warning output-configure output-make > ./report-test8 |
269 | grep Error output-configure output-make >> ./report-test13 | 190 | grep Error output-configure output-make >> ./report-test8 |
270 | cp output-configure oc13 | 191 | cp output-configure oc8 |
271 | cp output-make om13 | 192 | cp output-make om8 |
272 | rm output-configure output-make | 193 | rm output-configure output-make |
273 | 194 | ||
274 | #***************************************************************** | 195 | #***************************************************************** |
275 | # TEST 14 | 196 | # TEST 9 |
276 | #***************************************************************** | ||
277 | # - disable overlayfs | ||
278 | #***************************************************************** | ||
279 | print_title "${arr[14]}" | ||
280 | # seccomp | ||
281 | cd firejail | ||
282 | make distclean | ||
283 | ./configure --prefix=/usr --disable-overlayfs --enable-fatal-warnings 2>&1 | tee ../output-configure | ||
284 | make -j4 2>&1 | tee ../output-make | ||
285 | cd .. | ||
286 | grep Warning output-configure output-make > ./report-test14 | ||
287 | grep Error output-configure output-make >> ./report-test14 | ||
288 | cp output-configure oc14 | ||
289 | cp output-make om14 | ||
290 | rm output-configure output-make | ||
291 | |||
292 | #***************************************************************** | ||
293 | # TEST 15 | ||
294 | #***************************************************************** | 197 | #***************************************************************** |
295 | # - enable apparmor | 198 | # - enable apparmor |
296 | #***************************************************************** | 199 | #***************************************************************** |
297 | print_title "${arr[15]}" | 200 | print_title "${arr[9]}" |
298 | # seccomp | 201 | # seccomp |
299 | cd firejail | 202 | cd firejail |
300 | make distclean | 203 | make distclean |
301 | ./configure --prefix=/usr --enable-apparmor --enable-fatal-warnings 2>&1 | tee ../output-configure | 204 | ./configure --prefix=/usr --enable-apparmor --enable-fatal-warnings 2>&1 | tee ../output-configure |
302 | make -j4 2>&1 | tee ../output-make | 205 | make -j4 2>&1 | tee ../output-make |
303 | cd .. | 206 | cd .. |
304 | grep Warning output-configure output-make > ./report-test15 | 207 | grep Warning output-configure output-make > ./report-test9 |
305 | grep Error output-configure output-make >> ./report-test15 | 208 | grep Error output-configure output-make >> ./report-test9 |
306 | cp output-configure oc15 | 209 | cp output-configure oc9 |
307 | cp output-make om15 | 210 | cp output-make om9 |
308 | rm output-configure output-make | 211 | rm output-configure output-make |
309 | 212 | ||
310 | 213 | ||
@@ -331,9 +234,3 @@ echo ${arr[6]} | |||
331 | echo ${arr[7]} | 234 | echo ${arr[7]} |
332 | echo ${arr[8]} | 235 | echo ${arr[8]} |
333 | echo ${arr[9]} | 236 | echo ${arr[9]} |
334 | echo ${arr[10]} | ||
335 | echo ${arr[11]} | ||
336 | echo ${arr[12]} | ||
337 | echo ${arr[13]} | ||
338 | echo ${arr[14]} | ||
339 | echo ${arr[15]} | ||
diff --git a/test/utils/fs-print.exp b/test/utils/fs-print.exp index 21f6f68ff..17757f35f 100755 --- a/test/utils/fs-print.exp +++ b/test/utils/fs-print.exp | |||
@@ -26,7 +26,8 @@ expect { | |||
26 | } | 26 | } |
27 | expect { | 27 | expect { |
28 | timeout {puts "TESTING ERROR 3\n";exit} | 28 | timeout {puts "TESTING ERROR 3\n";exit} |
29 | "blacklist /bin/su" | 29 | "blacklist /usr/bin/su" {puts "Arch Linux";} |
30 | "blacklist /bin/su" {puts "Debian"} | ||
30 | } | 31 | } |
31 | after 100 | 32 | after 100 |
32 | puts "\nall done\n" | 33 | puts "\nall done\n" |