diff options
author | netblue30 <netblue30@yahoo.com> | 2015-12-12 09:11:52 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-12-12 09:11:52 -0500 |
commit | d9efe384aaff0134b9502c447b92a81dab3dd68e (patch) | |
tree | d7de8163524ef73d8dfb6492b9a8502cdeed490f /test | |
parent | fixes (diff) | |
download | firejail-d9efe384aaff0134b9502c447b92a81dab3dd68e.tar.gz firejail-d9efe384aaff0134b9502c447b92a81dab3dd68e.tar.zst firejail-d9efe384aaff0134b9502c447b92a81dab3dd68e.zip |
compile test
Diffstat (limited to 'test')
-rwxr-xr-x | test/compile/compile.sh | 130 |
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 | |||
3 | arr[1]="TEST 1: standard compilation" | ||
4 | arr[2]="TEST 2: compile seccomp disabled" | ||
5 | arr[3]="TEST 3: compile chroot disabled" | ||
6 | arr[4]="TEST 4: compile bind disabled" | ||
7 | |||
8 | |||
9 | # remove previous reports and output file | ||
10 | cleanup() { | ||
11 | rm -f report* | ||
12 | rm -fr firejail | ||
13 | } | ||
14 | |||
15 | print_title() { | ||
16 | echo | ||
17 | echo | ||
18 | echo | ||
19 | echo "**************************************************" | ||
20 | echo $1 | ||
21 | echo "**************************************************" | ||
22 | } | ||
23 | |||
24 | while [ $# -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. | ||
36 | done | ||
37 | |||
38 | cleanup | ||
39 | # enable sudo | ||
40 | sudo ls -al | ||
41 | |||
42 | #***************************************************************** | ||
43 | # TEST 1 | ||
44 | #***************************************************************** | ||
45 | # - checkout source code | ||
46 | # - check compilation | ||
47 | # - install | ||
48 | #***************************************************************** | ||
49 | print_title "${arr[1]}" | ||
50 | git clone https://github.com/netblue30/firejail.git | ||
51 | cd firejail | ||
52 | ./configure --prefix=/usr --enable-fatal-warnings 2>&1 | tee ../output-configure | ||
53 | make -j4 2>&1 | tee ../output-make | ||
54 | sudo make install 2>&1 | tee ../output-install | ||
55 | cd .. | ||
56 | grep Warning output-configure output-make output-install > ./report-test1 | ||
57 | grep Error output-configure output-make output-install >> ./report-test1 | ||
58 | rm output-configure output-make output-install | ||
59 | |||
60 | |||
61 | #***************************************************************** | ||
62 | # TEST 2 | ||
63 | #***************************************************************** | ||
64 | # - disable seccomp configuration | ||
65 | # - check compilation | ||
66 | #***************************************************************** | ||
67 | print_title "${arr[2]}" | ||
68 | # seccomp | ||
69 | cd firejail | ||
70 | make distclean | ||
71 | ./configure --prefix=/usr --disable-seccomp --enable-fatal-warnings 2>&1 | tee ../output-configure | ||
72 | make -j4 2>&1 | tee ../output-make | ||
73 | cd .. | ||
74 | grep Warning output-configure output-make > ./report-test2 | ||
75 | grep Error output-configure output-make >> ./report-test2 | ||
76 | rm output-configure output-make | ||
77 | |||
78 | #***************************************************************** | ||
79 | # TEST 3 | ||
80 | #***************************************************************** | ||
81 | # - disable chroot configuration | ||
82 | # - check compilation | ||
83 | #***************************************************************** | ||
84 | print_title "${arr[3]}" | ||
85 | # seccomp | ||
86 | cd firejail | ||
87 | make distclean | ||
88 | ./configure --prefix=/usr --disable-chroot --enable-fatal-warnings 2>&1 | tee ../output-configure | ||
89 | make -j4 2>&1 | tee ../output-make | ||
90 | cd .. | ||
91 | grep Warning output-configure output-make > ./report-test3 | ||
92 | grep Error output-configure output-make >> ./report-test3 | ||
93 | rm output-configure output-make | ||
94 | |||
95 | #***************************************************************** | ||
96 | # TEST 4 | ||
97 | #***************************************************************** | ||
98 | # - disable bindconfiguration | ||
99 | # - check compilation | ||
100 | #***************************************************************** | ||
101 | print_title "${arr[3]}" | ||
102 | # seccomp | ||
103 | cd firejail | ||
104 | make distclean | ||
105 | ./configure --prefix=/usr --disable-bind --enable-fatal-warnings 2>&1 | tee ../output-configure | ||
106 | make -j4 2>&1 | tee ../output-make | ||
107 | cd .. | ||
108 | grep Warning output-configure output-make > ./report-test4 | ||
109 | grep Error output-configure output-make >> ./report-test4 | ||
110 | rm output-configure output-make | ||
111 | |||
112 | |||
113 | #***************************************************************** | ||
114 | # PRINT REPORTS | ||
115 | #***************************************************************** | ||
116 | echo | ||
117 | echo | ||
118 | echo | ||
119 | echo | ||
120 | echo "**********************************************************" | ||
121 | echo "TEST RESULTS" | ||
122 | echo "**********************************************************" | ||
123 | |||
124 | wc -l report-test* | ||
125 | echo | ||
126 | |||
127 | |||
128 | |||
129 | |||
130 | exit | ||