diff options
-rw-r--r-- | Makefile.in | 10 | ||||
-rwxr-xr-x | test/apps-x11/apps-x11.sh (renamed from test/test-apps-x11.sh) | 18 | ||||
-rwxr-xr-x | test/apps-x11/chromium.exp (renamed from test/chromium-x11.exp) | 3 | ||||
-rwxr-xr-x | test/apps-x11/firefox.exp (renamed from test/firefox-x11.exp) | 3 | ||||
-rwxr-xr-x | test/apps-x11/icedove.exp (renamed from test/icedove-x11.exp) | 3 | ||||
-rwxr-xr-x | test/apps-x11/transmission-gtk.exp (renamed from test/transmission-gtk-x11.exp) | 3 | ||||
-rwxr-xr-x | test/apps-x11/xterm.exp (renamed from test/xterm-x11.exp) | 3 | ||||
-rwxr-xr-x | test/auto/autotest.sh | 202 | ||||
-rwxr-xr-x | test/firemon/caps.exp (renamed from test/firemon-caps.exp) | 3 | ||||
-rw-r--r-- | test/firemon/caps1.profile (renamed from test/caps1.profile) | 0 | ||||
-rw-r--r-- | test/firemon/caps2.profile (renamed from test/caps2.profile) | 0 | ||||
-rwxr-xr-x | test/firemon/firemon.sh | 10 | ||||
-rwxr-xr-x | test/firemon/seccomp.exp (renamed from test/firemon-seccomp.exp) | 3 | ||||
-rwxr-xr-x | test/test.sh | 2 |
14 files changed, 52 insertions, 211 deletions
diff --git a/Makefile.in b/Makefile.in index 93104bc02..c93fc401d 100644 --- a/Makefile.in +++ b/Makefile.in | |||
@@ -243,6 +243,8 @@ dist: | |||
243 | cd $(NAME)-$(VERSION); mkdir -p test; cp -a ../test/profiles test/.; cd .. | 243 | cd $(NAME)-$(VERSION); mkdir -p test; cp -a ../test/profiles test/.; cd .. |
244 | cd $(NAME)-$(VERSION); mkdir -p test; cp -a ../test/apps test/.; cd .. | 244 | cd $(NAME)-$(VERSION); mkdir -p test; cp -a ../test/apps test/.; cd .. |
245 | cd $(NAME)-$(VERSION); mkdir -p test; cp -a ../test/utils test/.; cd .. | 245 | cd $(NAME)-$(VERSION); mkdir -p test; cp -a ../test/utils test/.; cd .. |
246 | cd $(NAME)-$(VERSION); mkdir -p test; cp -a ../test/apps-x11 test/.; cd .. | ||
247 | cd $(NAME)-$(VERSION); mkdir -p test; cp -a ../test/firemon test/.; cd .. | ||
246 | cd $(NAME)-$(VERSION); rm -fr `find . -name .svn`; rm -fr $(NAME)-$(VERSION); cd .. | 248 | cd $(NAME)-$(VERSION); rm -fr `find . -name .svn`; rm -fr $(NAME)-$(VERSION); cd .. |
247 | tar -cjvf $(NAME)-$(VERSION).tar.bz2 $(NAME)-$(VERSION) | 249 | tar -cjvf $(NAME)-$(VERSION).tar.bz2 $(NAME)-$(VERSION) |
248 | rm -fr $(NAME)-$(VERSION) | 250 | rm -fr $(NAME)-$(VERSION) |
@@ -271,8 +273,14 @@ test-profiles: | |||
271 | test-apps: | 273 | test-apps: |
272 | cd test/apps; ./apps.sh | grep TESTING | 274 | cd test/apps; ./apps.sh | grep TESTING |
273 | 275 | ||
276 | test-apps-x11: | ||
277 | cd test/apps-x11; ./apps-x11.sh | grep TESTING | ||
278 | |||
279 | test-firemon: | ||
280 | cd test/firemon; ./firemon.sh | grep TESTING | ||
281 | |||
274 | test-utils: | 282 | test-utils: |
275 | cd test/utils; ./utils.sh | grep TESTING | 283 | cd test/utils; ./utils.sh | grep TESTING |
276 | 284 | ||
277 | test: test-profiles test-utils test-apps | 285 | test: test-profiles test-utils test-apps test-apps-x11 test-firemon |
278 | echo "TEST COMPLETE" | 286 | echo "TEST COMPLETE" |
diff --git a/test/test-apps-x11.sh b/test/apps-x11/apps-x11.sh index 93d984501..938d4c993 100755 --- a/test/test-apps-x11.sh +++ b/test/apps-x11/apps-x11.sh | |||
@@ -1,10 +1,16 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | export MALLOC_CHECK_=3 | ||
7 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | ||
2 | 8 | ||
3 | which xterm | 9 | which xterm |
4 | if [ "$?" -eq 0 ]; | 10 | if [ "$?" -eq 0 ]; |
5 | then | 11 | then |
6 | echo "TESTING: xterm x11" | 12 | echo "TESTING: xterm x11" |
7 | ./xterm-x11.exp | 13 | ./xterm.exp |
8 | else | 14 | else |
9 | echo "TESTING: xterm not found" | 15 | echo "TESTING: xterm not found" |
10 | fi | 16 | fi |
@@ -13,7 +19,7 @@ which firefox | |||
13 | if [ "$?" -eq 0 ]; | 19 | if [ "$?" -eq 0 ]; |
14 | then | 20 | then |
15 | echo "TESTING: firefox x11" | 21 | echo "TESTING: firefox x11" |
16 | ./firefox-x11.exp | 22 | ./firefox.exp |
17 | else | 23 | else |
18 | echo "TESTING: firefox not found" | 24 | echo "TESTING: firefox not found" |
19 | fi | 25 | fi |
@@ -22,7 +28,7 @@ which chromium | |||
22 | if [ "$?" -eq 0 ]; | 28 | if [ "$?" -eq 0 ]; |
23 | then | 29 | then |
24 | echo "TESTING: chromium x11" | 30 | echo "TESTING: chromium x11" |
25 | ./chromium-x11.exp | 31 | ./chromium.exp |
26 | else | 32 | else |
27 | echo "TESTING: chromium not found" | 33 | echo "TESTING: chromium not found" |
28 | fi | 34 | fi |
@@ -31,7 +37,7 @@ which transmission-gtk | |||
31 | if [ "$?" -eq 0 ]; | 37 | if [ "$?" -eq 0 ]; |
32 | then | 38 | then |
33 | echo "TESTING: transmission-gtk x11" | 39 | echo "TESTING: transmission-gtk x11" |
34 | ./transmission-gtk-x11.exp | 40 | ./transmission-gtk.exp |
35 | else | 41 | else |
36 | echo "TESTING: transmission-gtk not found" | 42 | echo "TESTING: transmission-gtk not found" |
37 | fi | 43 | fi |
@@ -40,8 +46,8 @@ which icedove | |||
40 | if [ "$?" -eq 0 ]; | 46 | if [ "$?" -eq 0 ]; |
41 | then | 47 | then |
42 | echo "TESTING: icedove x11" | 48 | echo "TESTING: icedove x11" |
43 | ./icedove-x11.exp | 49 | ./icedove.exp |
44 | else | 50 | else |
45 | echo "TESTING: chromium not found" | 51 | echo "TESTING: icedovenot found" |
46 | fi | 52 | fi |
47 | 53 | ||
diff --git a/test/chromium-x11.exp b/test/apps-x11/chromium.exp index bcac3233c..11677a28f 100755 --- a/test/chromium-x11.exp +++ b/test/apps-x11/chromium.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/firefox-x11.exp b/test/apps-x11/firefox.exp index 7e30437db..f7c128690 100755 --- a/test/firefox-x11.exp +++ b/test/apps-x11/firefox.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/icedove-x11.exp b/test/apps-x11/icedove.exp index 6f8eee90d..ca6a49978 100755 --- a/test/icedove-x11.exp +++ b/test/apps-x11/icedove.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/transmission-gtk-x11.exp b/test/apps-x11/transmission-gtk.exp index 4ee3de701..67b3fd202 100755 --- a/test/transmission-gtk-x11.exp +++ b/test/apps-x11/transmission-gtk.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/xterm-x11.exp b/test/apps-x11/xterm.exp index 592f77659..26e58953e 100755 --- a/test/xterm-x11.exp +++ b/test/apps-x11/xterm.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/auto/autotest.sh b/test/auto/autotest.sh deleted file mode 100755 index 0fb7565af..000000000 --- a/test/auto/autotest.sh +++ /dev/null | |||
@@ -1,202 +0,0 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | arr[1]="TEST 1: svn and standard compilation" | ||
4 | arr[2]="TEST 2: cppcheck" | ||
5 | arr[3]="TEST 3: compile seccomp disabled, chroot disabled, bind disabled" | ||
6 | arr[4]="TEST 4: rvtest" | ||
7 | arr[5]="TEST 5: expect test as root, no malloc perturb" | ||
8 | arr[6]="TEST 6: expect test as user, no malloc perturb" | ||
9 | arr[7]="TEST 7: expect test as root, malloc perturb" | ||
10 | arr[8]="TEST 8: expect test as user, malloc perturb" | ||
11 | |||
12 | |||
13 | # remove previous reports and output file | ||
14 | cleanup() { | ||
15 | rm -f out-test | ||
16 | rm -f output* | ||
17 | rm -f report* | ||
18 | rm -fr firejail-trunk | ||
19 | } | ||
20 | |||
21 | print_title() { | ||
22 | echo | ||
23 | echo | ||
24 | echo | ||
25 | echo "**************************************************" | ||
26 | echo $1 | ||
27 | echo "**************************************************" | ||
28 | } | ||
29 | |||
30 | while [ $# -gt 0 ]; do # Until you run out of parameters . . . | ||
31 | case "$1" in | ||
32 | --clean) | ||
33 | cleanup | ||
34 | exit | ||
35 | ;; | ||
36 | --help) | ||
37 | echo "./autotest.sh [--clean|--help]" | ||
38 | exit | ||
39 | ;; | ||
40 | esac | ||
41 | shift # Check next set of parameters. | ||
42 | done | ||
43 | |||
44 | cleanup | ||
45 | # enable sudo | ||
46 | sudo ls -al | ||
47 | |||
48 | #***************************************************************** | ||
49 | # TEST 1 | ||
50 | #***************************************************************** | ||
51 | # - checkout source code | ||
52 | # - check compilation | ||
53 | # - install | ||
54 | #***************************************************************** | ||
55 | print_title "${arr[1]}" | ||
56 | svn checkout svn://svn.code.sf.net/p/firejail/code-0/trunk firejail-trunk | ||
57 | cd firejail-trunk | ||
58 | ./configure --prefix=/usr 2>&1 | tee ../output-configure | ||
59 | make -j4 2>&1 | tee ../output-make | ||
60 | sudo make install 2>&1 | tee ../output-install | ||
61 | cd src/tools | ||
62 | gcc -o rvtest rvtest.c | ||
63 | cd ../.. | ||
64 | cd test | ||
65 | sudo ./configure > /dev/null | ||
66 | cd ../.. | ||
67 | grep warning output-configure output-make output-install > ./report-test1 | ||
68 | grep error output-configure output-make output-install >> ./report-test1 | ||
69 | cat report-test1 > out-test1 | ||
70 | |||
71 | #***************************************************************** | ||
72 | # TEST 2 | ||
73 | #***************************************************************** | ||
74 | # - run cppcheck | ||
75 | #***************************************************************** | ||
76 | print_title "${arr[2]}" | ||
77 | cd firejail-trunk | ||
78 | cp /home/netblue/bin/cfg/std.cfg . | ||
79 | cppcheck --force . 2>&1 | tee ../output-cppcheck | ||
80 | cd .. | ||
81 | grep error output-cppcheck > report-test2 | ||
82 | cat report-test2 > out-test2 | ||
83 | |||
84 | #***************************************************************** | ||
85 | # TEST 3 | ||
86 | #***************************************************************** | ||
87 | # - disable seccomp configuration | ||
88 | # - check compilation | ||
89 | #***************************************************************** | ||
90 | print_title "${arr[3]}" | ||
91 | # seccomp | ||
92 | cd firejail-trunk | ||
93 | make distclean | ||
94 | ./configure --prefix=/usr --disable-seccomp 2>&1 | tee ../output-configure-noseccomp | ||
95 | make -j4 2>&1 | tee ../output-make-noseccomp | ||
96 | cd .. | ||
97 | grep warning output-configure-noseccomp output-make-noseccomp > ./report-test3 | ||
98 | grep error output-configure-noseccomp output-make-noseccomp >> ./report-test3 | ||
99 | # chroot | ||
100 | cd firejail-trunk | ||
101 | make distclean | ||
102 | ./configure --prefix=/usr --disable-chroot 2>&1 | tee ../output-configure-nochroot | ||
103 | make -j4 2>&1 | tee ../output-make-nochroot | ||
104 | cd .. | ||
105 | grep warning output-configure-nochroot output-make-nochroot >> ./report-test3 | ||
106 | grep error output-configure-nochroot output-make-nochroot >> ./report-test3 | ||
107 | # bind | ||
108 | cd firejail-trunk | ||
109 | make distclean | ||
110 | ./configure --prefix=/usr --disable-bind 2>&1 | tee ../output-configure-nobind | ||
111 | make -j4 2>&1 | tee ../output-make-nobind | ||
112 | cd .. | ||
113 | grep warning output-configure-nobind output-make-nobind >> ./report-test3 | ||
114 | grep error output-configure-nobind output-make-nobind >> ./report-test3 | ||
115 | # save result | ||
116 | cat report-test3 > out-test3 | ||
117 | |||
118 | #***************************************************************** | ||
119 | # TEST 4 | ||
120 | #***************************************************************** | ||
121 | # - rvtest | ||
122 | #***************************************************************** | ||
123 | print_title "${arr[4]}" | ||
124 | cd firejail-trunk | ||
125 | cd test | ||
126 | ../src/tools/rvtest test.rv 2>/dev/null | tee ../../output-test4 | grep TESTING | ||
127 | cd ../.. | ||
128 | grep TESTING output-test4 > ./report-test4 | ||
129 | grep ERROR report-test4 > out-test4 | ||
130 | |||
131 | |||
132 | #***************************************************************** | ||
133 | # TEST 5 | ||
134 | #***************************************************************** | ||
135 | # - expect test as root, no malloc perturb | ||
136 | #***************************************************************** | ||
137 | print_title "${arr[5]}" | ||
138 | cd firejail-trunk/test | ||
139 | sudo ./test-root.sh 2>&1 | tee ../../output-test5 | grep TESTING | ||
140 | cd ../.. | ||
141 | grep TESTING output-test5 > ./report-test5 | ||
142 | grep ERROR report-test5 > out-test5 | ||
143 | |||
144 | #***************************************************************** | ||
145 | # TEST 6 | ||
146 | #***************************************************************** | ||
147 | # - expect test as user, no malloc perturb | ||
148 | #***************************************************************** | ||
149 | print_title "${arr[6]}" | ||
150 | cd firejail-trunk/test | ||
151 | ./test.sh 2>&1 | tee ../../output-test6 | grep TESTING | ||
152 | cd ../.. | ||
153 | grep TESTING output-test6 > ./report-test6 | ||
154 | grep ERROR report-test6 > out-test6 | ||
155 | |||
156 | |||
157 | |||
158 | #***************************************************************** | ||
159 | # TEST 7 | ||
160 | #***************************************************************** | ||
161 | # - expect test as root, malloc perturb | ||
162 | #***************************************************************** | ||
163 | print_title "${arr[7]}" | ||
164 | export MALLOC_CHECK_=3 | ||
165 | export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) | ||
166 | cd firejail-trunk/test | ||
167 | sudo ./test-root.sh 2>&1 | tee ../../output-test7 | grep TESTING | ||
168 | cd ../.. | ||
169 | grep TESTING output-test7 > ./report-test7 | ||
170 | grep ERROR report-test7 > out-test7 | ||
171 | |||
172 | #***************************************************************** | ||
173 | # TEST 8 | ||
174 | #***************************************************************** | ||
175 | # - expect test as user, malloc perturb | ||
176 | #***************************************************************** | ||
177 | print_title "${arr[8]}" | ||
178 | cd firejail-trunk/test | ||
179 | ./test.sh 2>&1 | tee ../../output-test8| grep TESTING | ||
180 | cd ../.. | ||
181 | grep TESTING output-test8 > ./report-test8 | ||
182 | grep ERROR report-test8 > out-test8 | ||
183 | |||
184 | #***************************************************************** | ||
185 | # PRINT REPORTS | ||
186 | #***************************************************************** | ||
187 | echo | ||
188 | echo | ||
189 | echo | ||
190 | echo | ||
191 | echo "**********************************************************" | ||
192 | echo "TEST RESULTS" | ||
193 | echo "**********************************************************" | ||
194 | |||
195 | wc -l out-test* | ||
196 | rm out-test* | ||
197 | echo | ||
198 | |||
199 | |||
200 | |||
201 | |||
202 | exit | ||
diff --git a/test/firemon-caps.exp b/test/firemon/caps.exp index 3dd6384db..ab1067921 100755 --- a/test/firemon-caps.exp +++ b/test/firemon/caps.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/caps1.profile b/test/firemon/caps1.profile index e14655b2e..e14655b2e 100644 --- a/test/caps1.profile +++ b/test/firemon/caps1.profile | |||
diff --git a/test/caps2.profile b/test/firemon/caps2.profile index cb2258c52..cb2258c52 100644 --- a/test/caps2.profile +++ b/test/firemon/caps2.profile | |||
diff --git a/test/firemon/firemon.sh b/test/firemon/firemon.sh new file mode 100755 index 000000000..edd548526 --- /dev/null +++ b/test/firemon/firemon.sh | |||
@@ -0,0 +1,10 @@ | |||
1 | #!/bin/bash | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | |||
6 | echo "TESTING: firemon --seccomp (test/firemon/seccomp.exp)" | ||
7 | ./seccomp.exp | ||
8 | |||
9 | echo "TESTING: firemon --caps (test/firemon/caps.exp)" | ||
10 | ./caps.exp | ||
diff --git a/test/firemon-seccomp.exp b/test/firemon/seccomp.exp index 55817faf3..a318e39b1 100755 --- a/test/firemon-seccomp.exp +++ b/test/firemon/seccomp.exp | |||
@@ -1,4 +1,7 @@ | |||
1 | #!/usr/bin/expect -f | 1 | #!/usr/bin/expect -f |
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2016 Firejail Authors | ||
4 | # License GPL v2 | ||
2 | 5 | ||
3 | set timeout 10 | 6 | set timeout 10 |
4 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
diff --git a/test/test.sh b/test/test.sh index 24827de9f..c88b8d486 100755 --- a/test/test.sh +++ b/test/test.sh | |||
@@ -171,8 +171,6 @@ else | |||
171 | echo "TESTING: dash not found" | 171 | echo "TESTING: dash not found" |
172 | fi | 172 | fi |
173 | 173 | ||
174 | ./test-apps-x11.sh | ||
175 | |||
176 | echo "TESTING: PID (pid.exp)" | 174 | echo "TESTING: PID (pid.exp)" |
177 | ./pid.exp | 175 | ./pid.exp |
178 | 176 | ||