aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.in4
-rwxr-xr-xtest/dns.exp69
-rwxr-xr-xtest/environment/dns.exp30
-rwxr-xr-xtest/environment/doubledash.exp (renamed from test/doubledash.exp)0
-rwxr-xr-xtest/environment/environment.sh16
-rwxr-xr-xtest/environment/extract_command.exp (renamed from test/extract_command.exp)2
-rwxr-xr-xtest/environment/output.exp (renamed from test/output.exp)7
-rwxr-xr-xtest/environment/output.sh (renamed from test/output.sh)0
-rwxr-xr-xtest/google-chrome.exp80
-rwxr-xr-xtest/test.sh7
10 files changed, 54 insertions, 161 deletions
diff --git a/Makefile.in b/Makefile.in
index c89f9167b..8726e4211 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -49,6 +49,10 @@ clean:
49 rm -f test/utils/index.html* 49 rm -f test/utils/index.html*
50 rm -f test/utils/wget-log 50 rm -f test/utils/wget-log
51 rm -f test/utils/lstesting 51 rm -f test/utils/lstesting
52 rm -f test/environment/index.html*
53 rm -f test/environment/wget-log*
54 rm -fr test/environment/-testdir
55 rm -f test/environment/logfile*
52 cd test/compile; ./compile.sh --clean; cd ../.. 56 cd test/compile; ./compile.sh --clean; cd ../..
53 cd test/dist-compile; ./compile.sh --clean; cd ../.. 57 cd test/dist-compile; ./compile.sh --clean; cd ../..
54 58
diff --git a/test/dns.exp b/test/dns.exp
deleted file mode 100755
index 96513f278..000000000
--- a/test/dns.exp
+++ /dev/null
@@ -1,69 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 30
4spawn $env(SHELL)
5match_max 100000
6
7# no chroot
8send -- "firejail --trace --dns=208.67.222.222 wget -q debian.org\r"
9expect {
10 timeout {puts "TESTING ERROR 1.1\n";exit}
11 "Child process initialized"
12}
13expect {
14 timeout {puts "TESTING ERROR 1.2\n";exit}
15 "1:wget:connect 208.67.222.222:53"
16}
17sleep 1
18
19send -- "rm index.html\r"
20sleep 1
21
22# with chroot
23send -- "firejail --chroot=/tmp/chroot --trace --dns=208.67.222.222 wget -q debian.org\r"
24expect {
25 timeout {puts "TESTING ERROR 2.1\n";exit}
26 "Child process initialized"
27}
28expect {
29 timeout {puts "TESTING ERROR 2.2\n";exit}
30 "1:wget:connect 208.67.222.222:53"
31}
32sleep 1
33
34send -- "rm index.html\r"
35sleep 1
36
37# net eth0
38send -- "firejail --net=eth0 --trace --dns=208.67.222.222 wget -q debian.org\r"
39expect {
40 timeout {puts "TESTING ERROR 3.1\n";exit}
41 "Child process initialized"
42}
43expect {
44 timeout {puts "TESTING ERROR 3.2\n";exit}
45 "1:wget:connect 208.67.222.222:53"
46}
47sleep 1
48
49send -- "rm index.html\r"
50sleep 1
51
52# net eth0 and chroot
53send -- "firejail --net=eth0 --chroot=/tmp/chroot --trace --dns=208.67.222.222 wget -q debian.org\r"
54expect {
55 timeout {puts "TESTING ERROR 4.1\n";exit}
56 "Child process initialized"
57}
58expect {
59 timeout {puts "TESTING ERROR 4.2\n";exit}
60 "1:wget:connect 208.67.222.222:53"
61}
62sleep 1
63
64send -- "rm index.html\r"
65sleep 1
66
67
68puts "\n"
69
diff --git a/test/environment/dns.exp b/test/environment/dns.exp
new file mode 100755
index 000000000..6ffb124cf
--- /dev/null
+++ b/test/environment/dns.exp
@@ -0,0 +1,30 @@
1#!/usr/bin/expect -f
2
3set timeout 30
4spawn $env(SHELL)
5match_max 100000
6
7# no chroot
8send -- "firejail --trace --dns=208.67.222.222 wget -q debian.org\r"
9expect {
10 timeout {puts "TESTING ERROR 1.1\n";exit}
11 "Child process initialized"
12}
13expect {
14 timeout {puts "TESTING ERROR 1.2\n";exit}
15 "connect"
16}
17expect {
18 timeout {puts "TESTING ERROR 1.2\n";exit}
19 "208.67.222.222"
20}
21expect {
22 timeout {puts "TESTING ERROR 1.2\n";exit}
23 "53"
24}
25
26after 100
27
28send -- "rm index.html\r"
29after 100
30puts "\nall done\n"
diff --git a/test/doubledash.exp b/test/environment/doubledash.exp
index 668468980..668468980 100755
--- a/test/doubledash.exp
+++ b/test/environment/doubledash.exp
diff --git a/test/environment/environment.sh b/test/environment/environment.sh
index 49b50797a..a6fe07a1c 100755
--- a/test/environment/environment.sh
+++ b/test/environment/environment.sh
@@ -6,6 +6,22 @@
6export MALLOC_CHECK_=3 6export MALLOC_CHECK_=3
7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) 7export MALLOC_PERTURB_=$(($RANDOM % 255 + 1))
8 8
9echo "TESTING: DNS (test/environment/dns.exp)"
10./dns.exp
11
12echo "TESTING: doubledash (test/environment/doubledash.exp"
13mkdir -- -testdir
14touch -- -testdir/ttt
15cp -- /bin/bash -testdir/.
16./doubledash.exp
17rm -fr -- -testdir
18
19echo "TESTING: output (test/environment/output.exp)"
20./output.exp
21
22echo "TESTING: extract command (extract_command.exp)"
23./extract_command.exp
24
9echo "TESTING: environment variables (test/environment/env.exp)" 25echo "TESTING: environment variables (test/environment/env.exp)"
10./env.exp 26./env.exp
11 27
diff --git a/test/extract_command.exp b/test/environment/extract_command.exp
index 851b793c9..266f66ff5 100755
--- a/test/extract_command.exp
+++ b/test/environment/extract_command.exp
@@ -17,7 +17,7 @@ expect {
17 timeout {puts "TESTING ERROR 2\n";exit} 17 timeout {puts "TESTING ERROR 2\n";exit}
18 "Parent is shutting down, bye" 18 "Parent is shutting down, bye"
19} 19}
20sleep 1 20after 100
21 21
22puts "\nall done\n" 22puts "\nall done\n"
23 23
diff --git a/test/output.exp b/test/environment/output.exp
index 90a9d64b6..10c325832 100755
--- a/test/output.exp
+++ b/test/environment/output.exp
@@ -59,8 +59,7 @@ expect {
59 timeout {puts "TESTING ERROR 7\n";exit} 59 timeout {puts "TESTING ERROR 7\n";exit}
60 "logfile.5" 60 "logfile.5"
61} 61}
62sleep 1 62after 100
63send -- "rm -f logfile*\r" 63send -- "rm -f logfile*\r"
64sleep 1 64after 100
65 65puts "\nall done\n"
66puts "\n"
diff --git a/test/output.sh b/test/environment/output.sh
index 2be188e3a..2be188e3a 100755
--- a/test/output.sh
+++ b/test/environment/output.sh
diff --git a/test/google-chrome.exp b/test/google-chrome.exp
deleted file mode 100755
index 389988e3c..000000000
--- a/test/google-chrome.exp
+++ /dev/null
@@ -1,80 +0,0 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail google-chrome www.gentoo.org\r"
8expect {
9 timeout {puts "TESTING ERROR 0\n";exit}
10 "Reading profile /etc/firejail/google-chrome.profile"
11}
12expect {
13 timeout {puts "TESTING ERROR 1\n";exit}
14 "Child process initialized"
15}
16sleep 10
17
18spawn $env(SHELL)
19send -- "firejail --list\r"
20expect {
21 timeout {puts "TESTING ERROR 3\n";exit}
22 ":firejail"
23}
24expect {
25 timeout {puts "TESTING ERROR 3.1\n";exit}
26 "google-chrome"
27}
28sleep 1
29
30# grsecurity exit
31send -- "file /proc/sys/kernel/grsecurity\r"
32expect {
33 timeout {puts "TESTING ERROR - grsecurity detection\n";exit}
34 "grsecurity: directory" {puts "grsecurity present, exiting...\n";exit}
35 "cannot open" {puts "grsecurity not present\n"}
36}
37
38send -- "firejail --name=blablabla\r"
39expect {
40 timeout {puts "TESTING ERROR 4\n";exit}
41 "Child process initialized"
42}
43sleep 2
44
45spawn $env(SHELL)
46send -- "firemon --seccomp\r"
47expect {
48 timeout {puts "TESTING ERROR 5\n";exit}
49 ":firejail google-chrome"
50}
51expect {
52 timeout {puts "TESTING ERROR 5.1\n";exit}
53 "Seccomp: 0"
54}
55expect {
56 timeout {puts "TESTING ERROR 5.1\n";exit}
57 "name=blablabla"
58}
59sleep 1
60send -- "firemon --caps\r"
61expect {
62 timeout {puts "TESTING ERROR 6\n";exit}
63 ":firejail google-chrome"
64}
65expect {
66 timeout {puts "TESTING ERROR 6.1\n";exit}
67 "CapBnd:"
68}
69expect {
70 timeout {puts "TESTING ERROR 6.2\n";exit}
71 "fffffffff"
72}
73expect {
74 timeout {puts "TESTING ERROR 6.3\n";exit}
75 "name=blablabla"
76}
77sleep 1
78
79puts "\n"
80
diff --git a/test/test.sh b/test/test.sh
index c4f0afd94..4d57aaad2 100755
--- a/test/test.sh
+++ b/test/test.sh
@@ -27,13 +27,6 @@ rm -fr auto2
27rm -fr auto3 27rm -fr auto3
28rm -fr auto4 28rm -fr auto4
29 29
30echo "TESTING: doubledash"
31mkdir -- -testdir
32touch -- -testdir/ttt
33cp -- /bin/bash -testdir/.
34./doubledash.exp
35rm -fr -- -testdir
36
37echo "TESTING: extract command (extract_command.exp)" 30echo "TESTING: extract command (extract_command.exp)"
38./extract_command.exp 31./extract_command.exp
39 32