aboutsummaryrefslogtreecommitdiffstats
path: root/test/features
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-02-02 10:09:37 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-02-02 10:09:37 -0500
commit107318c44671cb366c9bb3d4c690b97d2d433f97 (patch)
treee955113636a50defe0c98397b83d53bee1152b8a /test/features
parent0.9.38 testing (diff)
downloadfirejail-107318c44671cb366c9bb3d4c690b97d2d433f97.tar.gz
firejail-107318c44671cb366c9bb3d4c690b97d2d433f97.tar.zst
firejail-107318c44671cb366c9bb3d4c690b97d2d433f97.zip
0.9.38 testing
Diffstat (limited to 'test/features')
-rwxr-xr-xtest/features/3.10.exp183
-rwxr-xr-xtest/features/3.9.exp80
-rw-r--r--test/features/features.txt2
-rwxr-xr-xtest/features/test.sh11
4 files changed, 274 insertions, 2 deletions
diff --git a/test/features/3.10.exp b/test/features/3.10.exp
new file mode 100755
index 000000000..47da7f1c2
--- /dev/null
+++ b/test/features/3.10.exp
@@ -0,0 +1,183 @@
1#!/usr/bin/expect -f
2#
3# whitelist tmp
4#
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9set overlay [lindex $argv 0]
10set chroot [lindex $argv 1]
11
12#
13# N
14#
15send -- "mkdir /tmp/test1dir\r"
16sleep 1
17send -- "touch /tmp/test1dir/test1\r"
18sleep 1
19send -- "firejail --noprofile --whitelist=/tmp/test1dir\r"
20expect {
21 timeout {puts "TESTING ERROR 0\n";exit}
22 "Child process initialized"
23}
24sleep 1
25
26send -- "ls -l /tmp | wc -l\r"
27expect {
28 timeout {puts "TESTING ERROR 1.1\n";exit}
29 "2"
30}
31send -- "ls -l /tmp\r"
32expect {
33 timeout {puts "TESTING ERROR 1.2\n";exit}
34 "netblue"
35}
36expect {
37 timeout {puts "TESTING ERROR 1.3\n";exit}
38 "netblue"
39}
40expect {
41 timeout {puts "TESTING ERROR 1.4\n";exit}
42 "test1dir"
43}
44
45send -- "ls -l /tmp/test1dir | wc -l\r"
46expect {
47 timeout {puts "TESTING ERROR 1.5\n";exit}
48 "2"
49}
50send -- "ls -l /tmp/test1dir\r"
51expect {
52 timeout {puts "TESTING ERROR 1.6\n";exit}
53 "netblue"
54}
55expect {
56 timeout {puts "TESTING ERROR 1.7\n";exit}
57 "netblue"
58}
59expect {
60 timeout {puts "TESTING ERROR 1.8\n";exit}
61 "test1"
62}
63
64
65after 100
66send -- "exit\r"
67sleep 1
68
69
70#
71# O
72#
73if { $overlay == "overlay" } {
74 send -- "firejail --noprofile --overlay --whitelist=/tmp/test1dir\r"
75 expect {
76 timeout {puts "TESTING ERROR 2\n";exit}
77 "Child process initialized"
78 }
79 sleep 1
80
81 send -- "ls -l /tmp | wc -l\r"
82 expect {
83 timeout {puts "TESTING ERROR 3.1\n";exit}
84 "2"
85 }
86 send -- "ls -l /tmp\r"
87 expect {
88 timeout {puts "TESTING ERROR 3.2\n";exit}
89 "netblue"
90 }
91 expect {
92 timeout {puts "TESTING ERROR 3.3\n";exit}
93 "netblue"
94 }
95 expect {
96 timeout {puts "TESTING ERROR 3.4\n";exit}
97 "test1dir"
98 }
99
100 send -- "ls -l /tmp/test1dir | wc -l\r"
101 expect {
102 timeout {puts "TESTING ERROR 3.5\n";exit}
103 "2"
104 }
105 send -- "ls -l /tmp/test1dir\r"
106 expect {
107 timeout {puts "TESTING ERROR 3.6\n";exit}
108 "netblue"
109 }
110 expect {
111 timeout {puts "TESTING ERROR 3.7\n";exit}
112 "netblue"
113 }
114 expect {
115 timeout {puts "TESTING ERROR 3.8\n";exit}
116 "test1"
117 }
118
119 after 100
120 send -- "exit\r"
121 sleep 1
122}
123
124#
125# C
126#
127if { $chroot == "chroot" } {
128 send -- "mkdir /tmp/chroot/tmp/test1dir\r"
129 sleep 1
130 send -- "touch /tmp/chroot/tmp/test1dir/test1\r"
131 sleep 1
132 send -- "firejail --noprofile --chroot=/tmp/chroot --whitelist=/tmp/test1dir\r"
133 expect {
134 timeout {puts "TESTING ERROR 4\n";exit}
135 "Child process initialized"
136 }
137 sleep 1
138
139 send -- "ls -l /tmp | wc -l\r"
140 expect {
141 timeout {puts "TESTING ERROR 5.1\n";exit}
142 "2"
143 }
144 send -- "ls -l /tmp\r"
145 expect {
146 timeout {puts "TESTING ERROR 5.2\n";exit}
147 "netblue"
148 }
149 expect {
150 timeout {puts "TESTING ERROR 5.3\n";exit}
151 "netblue"
152 }
153 expect {
154 timeout {puts "TESTING ERROR 5.4\n";exit}
155 "test1dir"
156 }
157
158 send -- "ls -l /tmp/test1dir | wc -l\r"
159 expect {
160 timeout {puts "TESTING ERROR 5.5\n";exit}
161 "2"
162 }
163 send -- "ls -l /tmp/test1dir\r"
164 expect {
165 timeout {puts "TESTING ERROR 5.6\n";exit}
166 "netblue"
167 }
168 expect {
169 timeout {puts "TESTING ERROR 5.7\n";exit}
170 "netblue"
171 }
172 expect {
173 timeout {puts "TESTING ERROR 5.8\n";exit}
174 "test1"
175 }
176
177 after 100
178 send -- "exit\r"
179 sleep 1
180}
181
182
183puts "\nall done\n"
diff --git a/test/features/3.9.exp b/test/features/3.9.exp
new file mode 100755
index 000000000..1dc556d78
--- /dev/null
+++ b/test/features/3.9.exp
@@ -0,0 +1,80 @@
1#!/usr/bin/expect -f
2#
3# whitelist dev
4#
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9set overlay [lindex $argv 0]
10set chroot [lindex $argv 1]
11
12#
13# N
14#
15send -- "firejail --noprofile --whitelist=/dev/tty --whitelist=/dev/shm --whitelist=/dev/null\r"
16expect {
17 timeout {puts "TESTING ERROR 0\n";exit}
18 "Child process initialized"
19}
20sleep 1
21
22send -- "ls -l /dev | wc -l\r"
23expect {
24 timeout {puts "TESTING ERROR 1.1\n";exit}
25 "4"
26}
27
28
29after 100
30send -- "exit\r"
31sleep 1
32
33
34#
35# O
36#
37if { $overlay == "overlay" } {
38 send -- "firejail --noprofile --overlay --whitelist=/dev/tty --whitelist=/dev/shm --whitelist=/dev/null\r"
39 expect {
40 timeout {puts "TESTING ERROR 2\n";exit}
41 "Child process initialized"
42 }
43 sleep 1
44
45 send -- "ls -l /dev | wc -l\r"
46 expect {
47 timeout {puts "TESTING ERROR 3.1\n";exit}
48 "4"
49 }
50
51
52 after 100
53 send -- "exit\r"
54 sleep 1
55}
56
57#
58# C
59#
60if { $chroot == "chroot" } {
61 send -- "firejail --noprofile --chroot=/tmp/chroot --whitelist=/dev/tty --whitelist=/dev/shm --whitelist=/dev/null\r"
62 expect {
63 timeout {puts "TESTING ERROR 4\n";exit}
64 "Child process initialized"
65 }
66 sleep 1
67
68 send -- "ls -l /dev | wc -l\r"
69 expect {
70 timeout {puts "TESTING ERROR 5.1\n";exit}
71 "4"
72 }
73
74 after 100
75 send -- "exit\r"
76 sleep 1
77}
78
79
80puts "\nall done\n"
diff --git a/test/features/features.txt b/test/features/features.txt
index ac5390bc9..7f5e27ee4 100644
--- a/test/features/features.txt
+++ b/test/features/features.txt
@@ -50,6 +50,8 @@ C - chroot filesystem
503.7 private-tmp 503.7 private-tmp
513.8 private-bin 513.8 private-bin
52 - O, C not working - todo 52 - O, C not working - todo
533.9 whitelist dev
543.10 whitelist tmp
53 55
54 56
55 57
diff --git a/test/features/test.sh b/test/features/test.sh
index 4e84f1f9c..495996551 100755
--- a/test/features/test.sh
+++ b/test/features/test.sh
@@ -92,7 +92,7 @@ echo "TESTING: 3.2 read-only"
92echo "TESTING: 3.3 blacklist" 92echo "TESTING: 3.3 blacklist"
93./3.3.exp $OVERLAY $CHROOT 93./3.3.exp $OVERLAY $CHROOT
94 94
95echo "TESTING: 3.4 whitelist" 95echo "TESTING: 3.4 whitelist home"
96./3.4.exp $OVERLAY $CHROOT 96./3.4.exp $OVERLAY $CHROOT
97 97
98echo "TESTING: 3.5 private-dev" 98echo "TESTING: 3.5 private-dev"
@@ -105,4 +105,11 @@ echo "TESTING: 3.7 private-tmp"
105./3.7.exp $OVERLAY $CHROOT 105./3.7.exp $OVERLAY $CHROOT
106 106
107echo "TESTING: 3.8 private-bin" 107echo "TESTING: 3.8 private-bin"
108./3.6.exp notworking notworking 108./3.8.exp notworking notworking
109
110echo "TESTING: 3.9 whitelist dev"
111./3.9.exp $OVERLAY $CHROOT
112
113echo "TESTING: 3.10 whitelist tmp"
114./3.10.exp $OVERLAY $CHROOT
115