aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-04-24 08:45:06 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-04-24 08:45:06 -0400
commit03443a4b88e3a2cc32b30b1124fde7399c9a138e (patch)
treed7db9f716b17064f9eac78692d97c2e69b43c3e9 /test
parentcompile cleanup (diff)
downloadfirejail-03443a4b88e3a2cc32b30b1124fde7399c9a138e.tar.gz
firejail-03443a4b88e3a2cc32b30b1124fde7399c9a138e.tar.zst
firejail-03443a4b88e3a2cc32b30b1124fde7399c9a138e.zip
compile tests
Diffstat (limited to 'test')
-rwxr-xr-xtest/dist-compile/compile.sh251
1 files changed, 251 insertions, 0 deletions
diff --git a/test/dist-compile/compile.sh b/test/dist-compile/compile.sh
new file mode 100755
index 000000000..a9c1656ee
--- /dev/null
+++ b/test/dist-compile/compile.sh
@@ -0,0 +1,251 @@
1#!/bin/bash
2
3arr[1]="TEST 1: standard compilation"
4arr[2]="TEST 2: compile seccomp disabled"
5arr[3]="TEST 3: compile chroot disabled"
6arr[4]="TEST 4: compile bind disabled"
7arr[5]="TEST 5: compile user namespace disabled"
8arr[6]="TEST 6: compile network disabled"
9arr[7]="TEST 7: compile X11 disabled"
10arr[8]="TEST 8: compile network restricted"
11arr[9]="TEST 9: compile file transfer disabled"
12
13
14# remove previous reports and output file
15cleanup() {
16 rm -f report*
17 rm -fr firejail
18 rm oc* om*
19}
20
21print_title() {
22 echo
23 echo
24 echo
25 echo "**************************************************"
26 echo $1
27 echo "**************************************************"
28}
29
30DIST="$1"
31while [ $# -gt 0 ]; do # Until you run out of parameters . . .
32 case "$1" in
33 --clean)
34 cleanup
35 exit
36 ;;
37 --help)
38 echo "./compile.sh [--clean|--help]"
39 exit
40 ;;
41 esac
42 shift # Check next set of parameters.
43done
44
45cleanup
46# enable sudo
47sudo ls -al
48
49
50#*****************************************************************
51# TEST 1
52#*****************************************************************
53# - checkout source code
54# - check compilation
55# - install
56#*****************************************************************
57print_title "${arr[1]}"
58echo "$DIST"
59tar -xjvf ../../$DIST.tar.bz2
60mv $DIST firejail
61
62cd firejail
63./configure --prefix=/usr --enable-fatal-warnings 2>&1 | tee ../output-configure
64make -j4 2>&1 | tee ../output-make
65sudo make install 2>&1 | tee ../output-install
66cd ..
67grep Warning output-configure output-make output-install > ./report-test1
68grep Error output-configure output-make output-install >> ./report-test1
69cp output-configure oc1
70cp output-make om1
71rm output-configure output-make output-install
72
73
74#*****************************************************************
75# TEST 2
76#*****************************************************************
77# - disable seccomp configuration
78# - check compilation
79#*****************************************************************
80print_title "${arr[2]}"
81# seccomp
82cd firejail
83make distclean
84./configure --prefix=/usr --disable-seccomp --enable-fatal-warnings 2>&1 | tee ../output-configure
85make -j4 2>&1 | tee ../output-make
86cd ..
87grep Warning output-configure output-make > ./report-test2
88grep Error output-configure output-make >> ./report-test2
89cp output-configure oc2
90cp output-make om2
91rm output-configure output-make
92
93#*****************************************************************
94# TEST 3
95#*****************************************************************
96# - disable chroot configuration
97# - check compilation
98#*****************************************************************
99print_title "${arr[3]}"
100# seccomp
101cd firejail
102make distclean
103./configure --prefix=/usr --disable-chroot --enable-fatal-warnings 2>&1 | tee ../output-configure
104make -j4 2>&1 | tee ../output-make
105cd ..
106grep Warning output-configure output-make > ./report-test3
107grep Error output-configure output-make >> ./report-test3
108cp output-configure oc3
109cp output-make om3
110rm output-configure output-make
111
112#*****************************************************************
113# TEST 4
114#*****************************************************************
115# - disable bind configuration
116# - check compilation
117#*****************************************************************
118print_title "${arr[4]}"
119# seccomp
120cd firejail
121make distclean
122./configure --prefix=/usr --disable-bind --enable-fatal-warnings 2>&1 | tee ../output-configure
123make -j4 2>&1 | tee ../output-make
124cd ..
125grep Warning output-configure output-make > ./report-test4
126grep Error output-configure output-make >> ./report-test4
127cp output-configure oc4
128cp output-make om4
129rm output-configure output-make
130
131#*****************************************************************
132# TEST 5
133#*****************************************************************
134# - disable user namespace configuration
135# - check compilation
136#*****************************************************************
137print_title "${arr[5]}"
138# seccomp
139cd firejail
140make distclean
141./configure --prefix=/usr --disable-userns --enable-fatal-warnings 2>&1 | tee ../output-configure
142make -j4 2>&1 | tee ../output-make
143cd ..
144grep Warning output-configure output-make > ./report-test5
145grep Error output-configure output-make >> ./report-test5
146cp output-configure oc5
147cp output-make om5
148rm output-configure output-make
149
150#*****************************************************************
151# TEST 6
152#*****************************************************************
153# - disable user namespace configuration
154# - check compilation
155#*****************************************************************
156print_title "${arr[6]}"
157# seccomp
158cd firejail
159make distclean
160./configure --prefix=/usr --disable-network --enable-fatal-warnings 2>&1 | tee ../output-configure
161make -j4 2>&1 | tee ../output-make
162cd ..
163grep Warning output-configure output-make > ./report-test6
164grep Error output-configure output-make >> ./report-test6
165cp output-configure oc6
166cp output-make om6
167rm output-configure output-make
168
169#*****************************************************************
170# TEST 7
171#*****************************************************************
172# - disable X11 support
173# - check compilation
174#*****************************************************************
175print_title "${arr[7]}"
176# seccomp
177cd firejail
178make distclean
179./configure --prefix=/usr --disable-x11 --enable-fatal-warnings 2>&1 | tee ../output-configure
180make -j4 2>&1 | tee ../output-make
181cd ..
182grep Warning output-configure output-make > ./report-test7
183grep Error output-configure output-make >> ./report-test7
184cp output-configure oc7
185cp output-make om7
186rm output-configure output-make
187
188
189#*****************************************************************
190# TEST 8
191#*****************************************************************
192# - enable network restricted
193# - check compilation
194#*****************************************************************
195print_title "${arr[8]}"
196# seccomp
197cd firejail
198make distclean
199./configure --prefix=/usr --enable-network=restricted --enable-fatal-warnings 2>&1 | tee ../output-configure
200make -j4 2>&1 | tee ../output-make
201cd ..
202grep Warning output-configure output-make > ./report-test8
203grep Error output-configure output-make >> ./report-test8
204cp output-configure oc8
205cp output-make om8
206rm output-configure output-make
207
208
209#*****************************************************************
210# TEST 9
211#*****************************************************************
212# - disable file transfer
213# - check compilation
214#*****************************************************************
215print_title "${arr[9]}"
216# seccomp
217cd firejail
218make distclean
219./configure --prefix=/usr --enable-network=restricted --enable-fatal-warnings 2>&1 | tee ../output-configure
220make -j4 2>&1 | tee ../output-make
221cd ..
222grep Warning output-configure output-make > ./report-test9
223grep Error output-configure output-make >> ./report-test9
224cp output-configure oc9
225cp output-make om9
226rm output-configure output-make
227
228
229#*****************************************************************
230# PRINT REPORTS
231#*****************************************************************
232echo
233echo
234echo
235echo
236echo "**********************************************************"
237echo "TEST RESULTS"
238echo "**********************************************************"
239
240wc -l report-test*
241echo
242echo "Legend:"
243echo ${arr[1]}
244echo ${arr[2]}
245echo ${arr[3]}
246echo ${arr[4]}
247echo ${arr[5]}
248echo ${arr[6]}
249echo ${arr[7]}
250echo ${arr[8]}
251echo ${arr[9]}