aboutsummaryrefslogtreecommitdiffstats
path: root/test/compile
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-12-12 09:11:52 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2015-12-12 09:11:52 -0500
commitd9efe384aaff0134b9502c447b92a81dab3dd68e (patch)
treed7de8163524ef73d8dfb6492b9a8502cdeed490f /test/compile
parentfixes (diff)
downloadfirejail-d9efe384aaff0134b9502c447b92a81dab3dd68e.tar.gz
firejail-d9efe384aaff0134b9502c447b92a81dab3dd68e.tar.zst
firejail-d9efe384aaff0134b9502c447b92a81dab3dd68e.zip
compile test
Diffstat (limited to 'test/compile')
-rwxr-xr-xtest/compile/compile.sh130
1 files changed, 130 insertions, 0 deletions
diff --git a/test/compile/compile.sh b/test/compile/compile.sh
new file mode 100755
index 000000000..f4440e321
--- /dev/null
+++ b/test/compile/compile.sh
@@ -0,0 +1,130 @@
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"
7
8
9# remove previous reports and output file
10cleanup() {
11 rm -f report*
12 rm -fr firejail
13}
14
15print_title() {
16 echo
17 echo
18 echo
19 echo "**************************************************"
20 echo $1
21 echo "**************************************************"
22}
23
24while [ $# -gt 0 ]; do # Until you run out of parameters . . .
25 case "$1" in
26 --clean)
27 cleanup
28 exit
29 ;;
30 --help)
31 echo "./autotest.sh [--clean|--help]"
32 exit
33 ;;
34 esac
35 shift # Check next set of parameters.
36done
37
38cleanup
39# enable sudo
40sudo ls -al
41
42#*****************************************************************
43# TEST 1
44#*****************************************************************
45# - checkout source code
46# - check compilation
47# - install
48#*****************************************************************
49print_title "${arr[1]}"
50git clone https://github.com/netblue30/firejail.git
51cd firejail
52./configure --prefix=/usr --enable-fatal-warnings 2>&1 | tee ../output-configure
53make -j4 2>&1 | tee ../output-make
54sudo make install 2>&1 | tee ../output-install
55cd ..
56grep Warning output-configure output-make output-install > ./report-test1
57grep Error output-configure output-make output-install >> ./report-test1
58rm output-configure output-make output-install
59
60
61#*****************************************************************
62# TEST 2
63#*****************************************************************
64# - disable seccomp configuration
65# - check compilation
66#*****************************************************************
67print_title "${arr[2]}"
68# seccomp
69cd firejail
70make distclean
71./configure --prefix=/usr --disable-seccomp --enable-fatal-warnings 2>&1 | tee ../output-configure
72make -j4 2>&1 | tee ../output-make
73cd ..
74grep Warning output-configure output-make > ./report-test2
75grep Error output-configure output-make >> ./report-test2
76rm output-configure output-make
77
78#*****************************************************************
79# TEST 3
80#*****************************************************************
81# - disable chroot configuration
82# - check compilation
83#*****************************************************************
84print_title "${arr[3]}"
85# seccomp
86cd firejail
87make distclean
88./configure --prefix=/usr --disable-chroot --enable-fatal-warnings 2>&1 | tee ../output-configure
89make -j4 2>&1 | tee ../output-make
90cd ..
91grep Warning output-configure output-make > ./report-test3
92grep Error output-configure output-make >> ./report-test3
93rm output-configure output-make
94
95#*****************************************************************
96# TEST 4
97#*****************************************************************
98# - disable bindconfiguration
99# - check compilation
100#*****************************************************************
101print_title "${arr[3]}"
102# seccomp
103cd firejail
104make distclean
105./configure --prefix=/usr --disable-bind --enable-fatal-warnings 2>&1 | tee ../output-configure
106make -j4 2>&1 | tee ../output-make
107cd ..
108grep Warning output-configure output-make > ./report-test4
109grep Error output-configure output-make >> ./report-test4
110rm output-configure output-make
111
112
113#*****************************************************************
114# PRINT REPORTS
115#*****************************************************************
116echo
117echo
118echo
119echo
120echo "**********************************************************"
121echo "TEST RESULTS"
122echo "**********************************************************"
123
124wc -l report-test*
125echo
126
127
128
129
130exit