aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-04-23 16:16:51 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-04-23 16:16:51 -0400
commit7e1c057aeda3b598838cb66b9e827fc087f70c54 (patch)
tree6d13b82ed69f1d3a5b5973072e2b5cc3ea3eca16
parenthexchat profile (diff)
downloadfirejail-7e1c057ae.tar.gz
firejail-7e1c057ae.tar.zst
firejail-7e1c057ae.zip
make testing
-rw-r--r--Makefile.in10
-rwxr-xr-xtest/apps-x11/apps-x11.sh (renamed from test/test-apps-x11.sh)18
-rwxr-xr-xtest/apps-x11/chromium.exp (renamed from test/chromium-x11.exp)3
-rwxr-xr-xtest/apps-x11/firefox.exp (renamed from test/firefox-x11.exp)3
-rwxr-xr-xtest/apps-x11/icedove.exp (renamed from test/icedove-x11.exp)3
-rwxr-xr-xtest/apps-x11/transmission-gtk.exp (renamed from test/transmission-gtk-x11.exp)3
-rwxr-xr-xtest/apps-x11/xterm.exp (renamed from test/xterm-x11.exp)3
-rwxr-xr-xtest/auto/autotest.sh202
-rwxr-xr-xtest/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-xtest/firemon/firemon.sh10
-rwxr-xr-xtest/firemon/seccomp.exp (renamed from test/firemon-seccomp.exp)3
-rwxr-xr-xtest/test.sh2
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:
271test-apps: 273test-apps:
272 cd test/apps; ./apps.sh | grep TESTING 274 cd test/apps; ./apps.sh | grep TESTING
273 275
276test-apps-x11:
277 cd test/apps-x11; ./apps-x11.sh | grep TESTING
278
279test-firemon:
280 cd test/firemon; ./firemon.sh | grep TESTING
281
274test-utils: 282test-utils:
275 cd test/utils; ./utils.sh | grep TESTING 283 cd test/utils; ./utils.sh | grep TESTING
276 284
277test: test-profiles test-utils test-apps 285test: 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
6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
2 8
3which xterm 9which xterm
4if [ "$?" -eq 0 ]; 10if [ "$?" -eq 0 ];
5then 11then
6 echo "TESTING: xterm x11" 12 echo "TESTING: xterm x11"
7 ./xterm-x11.exp 13 ./xterm.exp
8else 14else
9 echo "TESTING: xterm not found" 15 echo "TESTING: xterm not found"
10fi 16fi
@@ -13,7 +19,7 @@ which firefox
13if [ "$?" -eq 0 ]; 19if [ "$?" -eq 0 ];
14then 20then
15 echo "TESTING: firefox x11" 21 echo "TESTING: firefox x11"
16 ./firefox-x11.exp 22 ./firefox.exp
17else 23else
18 echo "TESTING: firefox not found" 24 echo "TESTING: firefox not found"
19fi 25fi
@@ -22,7 +28,7 @@ which chromium
22if [ "$?" -eq 0 ]; 28if [ "$?" -eq 0 ];
23then 29then
24 echo "TESTING: chromium x11" 30 echo "TESTING: chromium x11"
25 ./chromium-x11.exp 31 ./chromium.exp
26else 32else
27 echo "TESTING: chromium not found" 33 echo "TESTING: chromium not found"
28fi 34fi
@@ -31,7 +37,7 @@ which transmission-gtk
31if [ "$?" -eq 0 ]; 37if [ "$?" -eq 0 ];
32then 38then
33 echo "TESTING: transmission-gtk x11" 39 echo "TESTING: transmission-gtk x11"
34 ./transmission-gtk-x11.exp 40 ./transmission-gtk.exp
35else 41else
36 echo "TESTING: transmission-gtk not found" 42 echo "TESTING: transmission-gtk not found"
37fi 43fi
@@ -40,8 +46,8 @@ which icedove
40if [ "$?" -eq 0 ]; 46if [ "$?" -eq 0 ];
41then 47then
42 echo "TESTING: icedove x11" 48 echo "TESTING: icedove x11"
43 ./icedove-x11.exp 49 ./icedove.exp
44else 50else
45 echo "TESTING: chromium not found" 51 echo "TESTING: icedovenot found"
46fi 52fi
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
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $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
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $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
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $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
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $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
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $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
3arr[1]="TEST 1: svn and standard compilation"
4arr[2]="TEST 2: cppcheck"
5arr[3]="TEST 3: compile seccomp disabled, chroot disabled, bind disabled"
6arr[4]="TEST 4: rvtest"
7arr[5]="TEST 5: expect test as root, no malloc perturb"
8arr[6]="TEST 6: expect test as user, no malloc perturb"
9arr[7]="TEST 7: expect test as root, malloc perturb"
10arr[8]="TEST 8: expect test as user, malloc perturb"
11
12
13# remove previous reports and output file
14cleanup() {
15 rm -f out-test
16 rm -f output*
17 rm -f report*
18 rm -fr firejail-trunk
19}
20
21print_title() {
22 echo
23 echo
24 echo
25 echo "**************************************************"
26 echo $1
27 echo "**************************************************"
28}
29
30while [ $# -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.
42done
43
44cleanup
45# enable sudo
46sudo ls -al
47
48#*****************************************************************
49# TEST 1
50#*****************************************************************
51# - checkout source code
52# - check compilation
53# - install
54#*****************************************************************
55print_title "${arr[1]}"
56svn checkout svn://svn.code.sf.net/p/firejail/code-0/trunk firejail-trunk
57cd firejail-trunk
58./configure --prefix=/usr 2>&1 | tee ../output-configure
59make -j4 2>&1 | tee ../output-make
60sudo make install 2>&1 | tee ../output-install
61cd src/tools
62gcc -o rvtest rvtest.c
63cd ../..
64cd test
65sudo ./configure > /dev/null
66cd ../..
67grep warning output-configure output-make output-install > ./report-test1
68grep error output-configure output-make output-install >> ./report-test1
69cat report-test1 > out-test1
70
71#*****************************************************************
72# TEST 2
73#*****************************************************************
74# - run cppcheck
75#*****************************************************************
76print_title "${arr[2]}"
77cd firejail-trunk
78cp /home/netblue/bin/cfg/std.cfg .
79cppcheck --force . 2>&1 | tee ../output-cppcheck
80cd ..
81grep error output-cppcheck > report-test2
82cat report-test2 > out-test2
83
84#*****************************************************************
85# TEST 3
86#*****************************************************************
87# - disable seccomp configuration
88# - check compilation
89#*****************************************************************
90print_title "${arr[3]}"
91# seccomp
92cd firejail-trunk
93make distclean
94./configure --prefix=/usr --disable-seccomp 2>&1 | tee ../output-configure-noseccomp
95make -j4 2>&1 | tee ../output-make-noseccomp
96cd ..
97grep warning output-configure-noseccomp output-make-noseccomp > ./report-test3
98grep error output-configure-noseccomp output-make-noseccomp >> ./report-test3
99# chroot
100cd firejail-trunk
101make distclean
102./configure --prefix=/usr --disable-chroot 2>&1 | tee ../output-configure-nochroot
103make -j4 2>&1 | tee ../output-make-nochroot
104cd ..
105grep warning output-configure-nochroot output-make-nochroot >> ./report-test3
106grep error output-configure-nochroot output-make-nochroot >> ./report-test3
107# bind
108cd firejail-trunk
109make distclean
110./configure --prefix=/usr --disable-bind 2>&1 | tee ../output-configure-nobind
111make -j4 2>&1 | tee ../output-make-nobind
112cd ..
113grep warning output-configure-nobind output-make-nobind >> ./report-test3
114grep error output-configure-nobind output-make-nobind >> ./report-test3
115# save result
116cat report-test3 > out-test3
117
118#*****************************************************************
119# TEST 4
120#*****************************************************************
121# - rvtest
122#*****************************************************************
123print_title "${arr[4]}"
124cd firejail-trunk
125cd test
126../src/tools/rvtest test.rv 2>/dev/null | tee ../../output-test4 | grep TESTING
127cd ../..
128grep TESTING output-test4 > ./report-test4
129grep ERROR report-test4 > out-test4
130
131
132#*****************************************************************
133# TEST 5
134#*****************************************************************
135# - expect test as root, no malloc perturb
136#*****************************************************************
137print_title "${arr[5]}"
138cd firejail-trunk/test
139sudo ./test-root.sh 2>&1 | tee ../../output-test5 | grep TESTING
140cd ../..
141grep TESTING output-test5 > ./report-test5
142grep ERROR report-test5 > out-test5
143
144#*****************************************************************
145# TEST 6
146#*****************************************************************
147# - expect test as user, no malloc perturb
148#*****************************************************************
149print_title "${arr[6]}"
150cd firejail-trunk/test
151./test.sh 2>&1 | tee ../../output-test6 | grep TESTING
152cd ../..
153grep TESTING output-test6 > ./report-test6
154grep ERROR report-test6 > out-test6
155
156
157
158#*****************************************************************
159# TEST 7
160#*****************************************************************
161# - expect test as root, malloc perturb
162#*****************************************************************
163print_title "${arr[7]}"
164export MALLOC_CHECK_=3
165export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
166cd firejail-trunk/test
167sudo ./test-root.sh 2>&1 | tee ../../output-test7 | grep TESTING
168cd ../..
169grep TESTING output-test7 > ./report-test7
170grep ERROR report-test7 > out-test7
171
172#*****************************************************************
173# TEST 8
174#*****************************************************************
175# - expect test as user, malloc perturb
176#*****************************************************************
177print_title "${arr[8]}"
178cd firejail-trunk/test
179./test.sh 2>&1 | tee ../../output-test8| grep TESTING
180cd ../..
181grep TESTING output-test8 > ./report-test8
182grep ERROR report-test8 > out-test8
183
184#*****************************************************************
185# PRINT REPORTS
186#*****************************************************************
187echo
188echo
189echo
190echo
191echo "**********************************************************"
192echo "TEST RESULTS"
193echo "**********************************************************"
194
195wc -l out-test*
196rm out-test*
197echo
198
199
200
201
202exit
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
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $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
6echo "TESTING: firemon --seccomp (test/firemon/seccomp.exp)"
7./seccomp.exp
8
9echo "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
3set timeout 10 6set timeout 10
4spawn $env(SHELL) 7spawn $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"
172fi 172fi
173 173
174./test-apps-x11.sh
175
176echo "TESTING: PID (pid.exp)" 174echo "TESTING: PID (pid.exp)"
177./pid.exp 175./pid.exp
178 176