diff options
author | netblue30 <netblue30@yahoo.com> | 2015-11-22 21:50:28 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-11-22 21:50:28 -0500 |
commit | 1cb3f220153b733e9fe86fc0b5ed6d7dbe27670b (patch) | |
tree | ec8782a9924ee48266b58e342d3c11dcc971d528 /test | |
parent | feature testing (diff) | |
download | firejail-1cb3f220153b733e9fe86fc0b5ed6d7dbe27670b.tar.gz firejail-1cb3f220153b733e9fe86fc0b5ed6d7dbe27670b.tar.zst firejail-1cb3f220153b733e9fe86fc0b5ed6d7dbe27670b.zip |
feature testing
Diffstat (limited to 'test')
-rwxr-xr-x | test/configure | 6 | ||||
-rwxr-xr-x | test/features/2.1.exp | 99 | ||||
-rwxr-xr-x | test/features/2.2.exp | 105 | ||||
-rwxr-xr-x | test/features/2.3.exp | 309 | ||||
-rwxr-xr-x | test/features/2.4.exp | 232 | ||||
-rw-r--r-- | test/features/features.txt | 11 | ||||
-rwxr-xr-x | test/features/test.sh | 12 |
7 files changed, 767 insertions, 7 deletions
diff --git a/test/configure b/test/configure index ae6a49eeb..1dd80ee9a 100755 --- a/test/configure +++ b/test/configure | |||
@@ -22,7 +22,7 @@ ROOTDIR="/tmp/chroot" # default chroot directory | |||
22 | DEFAULT_FILES="/bin/bash /bin/sh " # basic chroot files | 22 | DEFAULT_FILES="/bin/bash /bin/sh " # basic chroot files |
23 | DEFAULT_FILES+="/etc/passwd /etc/nsswitch.conf /etc/group " | 23 | DEFAULT_FILES+="/etc/passwd /etc/nsswitch.conf /etc/group " |
24 | DEFAULT_FILES+=`find /lib -name libnss*` # files required by glibc | 24 | DEFAULT_FILES+=`find /lib -name libnss*` # files required by glibc |
25 | DEFAULT_FILES+=" /bin/cp /bin/ls /bin/cat /bin/ps /bin/grep /usr/bin/id /usr/bin/whoami /usr/bin/wc /usr/bin/wget /bin/umount" | 25 | DEFAULT_FILES+=" /bin/cp /bin/ls /bin/cat /bin/ps /bin/ping /sbin/ifconfig /bin/hostname /bin/grep /usr/bin/dig /usr/bin/openssl /usr/bin/id /usr/bin/getent /usr/bin/whoami /usr/bin/wc /usr/bin/wget /bin/umount" |
26 | 26 | ||
27 | rm -fr $ROOTDIR | 27 | rm -fr $ROOTDIR |
28 | mkdir -p $ROOTDIR/{root,bin,lib,lib64,usr,home,etc,dev/shm,tmp,var/run,var/tmp,var/lock,var/log,proc} | 28 | mkdir -p $ROOTDIR/{root,bin,lib,lib64,usr,home,etc,dev/shm,tmp,var/run,var/tmp,var/lock,var/log,proc} |
@@ -33,6 +33,10 @@ mkdir $ROOTDIR/boot | |||
33 | mkdir $ROOTDIR/selinux | 33 | mkdir $ROOTDIR/selinux |
34 | cp /etc/passwd $ROOTDIR/etc/. | 34 | cp /etc/passwd $ROOTDIR/etc/. |
35 | cp /etc/group $ROOTDIR/etc/. | 35 | cp /etc/group $ROOTDIR/etc/. |
36 | cp /etc/hosts $ROOTDIR/etc/. | ||
37 | mkdir -p $ROOTDIR/usr/lib/x86_64-linux-gnu | ||
38 | cp -a /usr/lib/x86_64-linux-gnu/openssl-1.0.0 $ROOTDIR/usr/lib/x86_64-linux-gnu/. | ||
39 | cp -a /usr/lib/ssl $ROOTDIR/usr/lib/. | ||
36 | touch $ROOTDIR/var/log/syslog | 40 | touch $ROOTDIR/var/log/syslog |
37 | touch $ROOTDIR/var/tmp/somefile | 41 | touch $ROOTDIR/var/tmp/somefile |
38 | SORTED=`for FILE in $* $DEFAULT_FILES; do echo " $FILE "; ldd $FILE | grep -v dynamic | cut -d " " -f 3; done | sort -u` | 42 | SORTED=`for FILE in $* $DEFAULT_FILES; do echo " $FILE "; ldd $FILE | grep -v dynamic | cut -d " " -f 3; done | sort -u` |
diff --git a/test/features/2.1.exp b/test/features/2.1.exp new file mode 100755 index 000000000..6b2b3f7f5 --- /dev/null +++ b/test/features/2.1.exp | |||
@@ -0,0 +1,99 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # | ||
3 | # hostname | ||
4 | # | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | # | ||
11 | # N | ||
12 | # | ||
13 | send -- "firejail --noprofile --hostname=bingo\r" | ||
14 | expect { | ||
15 | timeout {puts "TESTING ERROR 0\n";exit} | ||
16 | "Child process initialized" | ||
17 | } | ||
18 | sleep 1 | ||
19 | |||
20 | send -- "hostname\r" | ||
21 | expect { | ||
22 | timeout {puts "TESTING ERROR 1\n";exit} | ||
23 | "bingo" | ||
24 | } | ||
25 | after 100 | ||
26 | send -- "getent hosts bingo\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
29 | "127.0.0.1" | ||
30 | } | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
33 | "bingo" | ||
34 | } | ||
35 | after 100 | ||
36 | send -- "exit\r" | ||
37 | sleep 1 | ||
38 | |||
39 | |||
40 | # | ||
41 | # O | ||
42 | # | ||
43 | send -- "firejail --noprofile --hostname=bingo --overlay\r" | ||
44 | expect { | ||
45 | timeout {puts "TESTING ERROR 2\n";exit} | ||
46 | "Child process initialized" | ||
47 | } | ||
48 | sleep 1 | ||
49 | |||
50 | send -- "hostname\r" | ||
51 | expect { | ||
52 | timeout {puts "TESTING ERROR 3\n";exit} | ||
53 | "bingo" | ||
54 | } | ||
55 | after 100 | ||
56 | send -- "getent hosts bingo\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
59 | "127.0.0.1" | ||
60 | } | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
63 | "bingo" | ||
64 | } | ||
65 | after 100 | ||
66 | send -- "exit\r" | ||
67 | sleep 1 | ||
68 | |||
69 | # | ||
70 | # C | ||
71 | # | ||
72 | send -- "firejail --noprofile --hostname=bingo --chroot=/tmp/chroot\r" | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 4\n";exit} | ||
75 | "Child process initialized" | ||
76 | } | ||
77 | sleep 1 | ||
78 | |||
79 | send -- "hostname\r" | ||
80 | expect { | ||
81 | timeout {puts "TESTING ERROR 5\n";exit} | ||
82 | "bingo" | ||
83 | } | ||
84 | after 100 | ||
85 | send -- "getent hosts bingo\r" | ||
86 | expect { | ||
87 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
88 | "127.0.0.1" | ||
89 | } | ||
90 | expect { | ||
91 | timeout {puts "TESTING ERROR 5.2\n";exit} | ||
92 | "bingo" | ||
93 | } | ||
94 | after 100 | ||
95 | send -- "exit\r" | ||
96 | sleep 1 | ||
97 | |||
98 | |||
99 | puts "\nall done\n" | ||
diff --git a/test/features/2.2.exp b/test/features/2.2.exp new file mode 100755 index 000000000..7dc1e6a7d --- /dev/null +++ b/test/features/2.2.exp | |||
@@ -0,0 +1,105 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # | ||
3 | # DNS | ||
4 | # | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | # | ||
11 | # N | ||
12 | # | ||
13 | send -- "firejail --noprofile --dns=4.2.2.1\r" | ||
14 | expect { | ||
15 | timeout {puts "TESTING ERROR 0\n";exit} | ||
16 | "Child process initialized" | ||
17 | } | ||
18 | sleep 1 | ||
19 | |||
20 | send -- "dig google.com\r" | ||
21 | expect { | ||
22 | timeout {puts "TESTING ERROR 1\n";exit} | ||
23 | "ANSWER SECTION" | ||
24 | } | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
27 | "google.com" | ||
28 | } | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
31 | "google.com" | ||
32 | } | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
35 | "SERVER: 4.2.2.1" | ||
36 | } | ||
37 | after 100 | ||
38 | send -- "exit\r" | ||
39 | sleep 1 | ||
40 | |||
41 | |||
42 | # | ||
43 | # O | ||
44 | # | ||
45 | send -- "firejail --noprofile --dns=4.2.2.1 --overlay\r" | ||
46 | expect { | ||
47 | timeout {puts "TESTING ERROR 2\n";exit} | ||
48 | "Child process initialized" | ||
49 | } | ||
50 | sleep 1 | ||
51 | |||
52 | send -- "dig google.com\r" | ||
53 | expect { | ||
54 | timeout {puts "TESTING ERROR 3\n";exit} | ||
55 | "ANSWER SECTION" | ||
56 | } | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
59 | "google.com" | ||
60 | } | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
63 | "google.com" | ||
64 | } | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 3.3\n";exit} | ||
67 | "SERVER: 4.2.2.1" | ||
68 | } | ||
69 | after 100 | ||
70 | send -- "exit\r" | ||
71 | sleep 1 | ||
72 | |||
73 | # | ||
74 | # C | ||
75 | # | ||
76 | send -- "firejail --noprofile --dns=4.2.2.1 --chroot=/tmp/chroot\r" | ||
77 | expect { | ||
78 | timeout {puts "TESTING ERROR 4\n";exit} | ||
79 | "Child process initialized" | ||
80 | } | ||
81 | sleep 1 | ||
82 | |||
83 | send -- "dig google.com\r" | ||
84 | expect { | ||
85 | timeout {puts "TESTING ERROR 5\n";exit} | ||
86 | "ANSWER SECTION" | ||
87 | } | ||
88 | expect { | ||
89 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
90 | "google.com" | ||
91 | } | ||
92 | expect { | ||
93 | timeout {puts "TESTING ERROR 5.2\n";exit} | ||
94 | "google.com" | ||
95 | } | ||
96 | expect { | ||
97 | timeout {puts "TESTING ERROR 5.3\n";exit} | ||
98 | "SERVER: 4.2.2.1" | ||
99 | } | ||
100 | after 100 | ||
101 | send -- "exit\r" | ||
102 | sleep 1 | ||
103 | |||
104 | |||
105 | puts "\nall done\n" | ||
diff --git a/test/features/2.3.exp b/test/features/2.3.exp new file mode 100755 index 000000000..a70005781 --- /dev/null +++ b/test/features/2.3.exp | |||
@@ -0,0 +1,309 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # | ||
3 | # mac-vlan | ||
4 | # | ||
5 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | # | ||
11 | # N | ||
12 | # | ||
13 | send -- "firejail --noprofile --net=eth0\r" | ||
14 | expect { | ||
15 | timeout {puts "TESTING ERROR 0\n";exit} | ||
16 | "Child process initialized" | ||
17 | } | ||
18 | sleep 1 | ||
19 | |||
20 | send -- "dig google.com\r" | ||
21 | expect { | ||
22 | timeout {puts "TESTING ERROR 1\n";exit} | ||
23 | "ANSWER SECTION" | ||
24 | } | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
27 | "google.com" | ||
28 | } | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
31 | "google.com" | ||
32 | } | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
35 | "SERVER:" | ||
36 | } | ||
37 | after 100 | ||
38 | |||
39 | send -- "/sbin/ifconfig\r" | ||
40 | expect { | ||
41 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
42 | "eth0" | ||
43 | } | ||
44 | expect { | ||
45 | timeout {puts "TESTING ERROR 1.5n";exit} | ||
46 | "Link" | ||
47 | } | ||
48 | expect { | ||
49 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
50 | "192.168.1" | ||
51 | } | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
54 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
55 | } | ||
56 | after 100 | ||
57 | |||
58 | send -- "exit\r" | ||
59 | sleep 1 | ||
60 | |||
61 | send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244\r" | ||
62 | expect { | ||
63 | timeout {puts "TESTING ERROR 0\n";exit} | ||
64 | "Child process initialized" | ||
65 | } | ||
66 | sleep 1 | ||
67 | |||
68 | send -- "dig google.com\r" | ||
69 | expect { | ||
70 | timeout {puts "TESTING ERROR 1\n";exit} | ||
71 | "ANSWER SECTION" | ||
72 | } | ||
73 | expect { | ||
74 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
75 | "google.com" | ||
76 | } | ||
77 | expect { | ||
78 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
79 | "google.com" | ||
80 | } | ||
81 | expect { | ||
82 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
83 | "SERVER:" | ||
84 | } | ||
85 | after 100 | ||
86 | |||
87 | send -- "/sbin/ifconfig\r" | ||
88 | expect { | ||
89 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
90 | "eth0" | ||
91 | } | ||
92 | expect { | ||
93 | timeout {puts "TESTING ERROR 1.5n";exit} | ||
94 | "Link" | ||
95 | } | ||
96 | expect { | ||
97 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
98 | "192.168.1.244" | ||
99 | } | ||
100 | expect { | ||
101 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
102 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
103 | } | ||
104 | after 100 | ||
105 | |||
106 | send -- "exit\r" | ||
107 | sleep 1 | ||
108 | |||
109 | # | ||
110 | # O | ||
111 | # | ||
112 | send -- "firejail --noprofile --net=eth0 --overlay\r" | ||
113 | expect { | ||
114 | timeout {puts "TESTING ERROR 2\n";exit} | ||
115 | "Child process initialized" | ||
116 | } | ||
117 | sleep 1 | ||
118 | |||
119 | send -- "dig google.com\r" | ||
120 | expect { | ||
121 | timeout {puts "TESTING ERROR 3\n";exit} | ||
122 | "ANSWER SECTION" | ||
123 | } | ||
124 | expect { | ||
125 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
126 | "google.com" | ||
127 | } | ||
128 | expect { | ||
129 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
130 | "google.com" | ||
131 | } | ||
132 | expect { | ||
133 | timeout {puts "TESTING ERROR 3.3\n";exit} | ||
134 | "SERVER" | ||
135 | } | ||
136 | after 100 | ||
137 | |||
138 | send -- "/sbin/ifconfig\r" | ||
139 | expect { | ||
140 | timeout {puts "TESTING ERROR 3.4\n";exit} | ||
141 | "eth0" | ||
142 | } | ||
143 | expect { | ||
144 | timeout {puts "TESTING ERROR 3.5\n";exit} | ||
145 | "Link" | ||
146 | } | ||
147 | expect { | ||
148 | timeout {puts "TESTING ERROR 3.6\n";exit} | ||
149 | "192.168.1" | ||
150 | } | ||
151 | expect { | ||
152 | timeout {puts "TESTING ERROR 3.7\n";exit} | ||
153 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
154 | } | ||
155 | after 100 | ||
156 | |||
157 | send -- "exit\r" | ||
158 | sleep 1 | ||
159 | |||
160 | send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --overlay\r" | ||
161 | expect { | ||
162 | timeout {puts "TESTING ERROR 2\n";exit} | ||
163 | "Child process initialized" | ||
164 | } | ||
165 | sleep 1 | ||
166 | |||
167 | send -- "dig google.com\r" | ||
168 | expect { | ||
169 | timeout {puts "TESTING ERROR 3\n";exit} | ||
170 | "ANSWER SECTION" | ||
171 | } | ||
172 | expect { | ||
173 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
174 | "google.com" | ||
175 | } | ||
176 | expect { | ||
177 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
178 | "google.com" | ||
179 | } | ||
180 | expect { | ||
181 | timeout {puts "TESTING ERROR 3.3\n";exit} | ||
182 | "SERVER" | ||
183 | } | ||
184 | after 100 | ||
185 | |||
186 | send -- "/sbin/ifconfig\r" | ||
187 | expect { | ||
188 | timeout {puts "TESTING ERROR 3.4\n";exit} | ||
189 | "eth0" | ||
190 | } | ||
191 | expect { | ||
192 | timeout {puts "TESTING ERROR 3.5\n";exit} | ||
193 | "Link" | ||
194 | } | ||
195 | expect { | ||
196 | timeout {puts "TESTING ERROR 3.6\n";exit} | ||
197 | "192.168.1.244" | ||
198 | } | ||
199 | expect { | ||
200 | timeout {puts "TESTING ERROR 3.7\n";exit} | ||
201 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
202 | } | ||
203 | after 100 | ||
204 | |||
205 | send -- "exit\r" | ||
206 | sleep 1 | ||
207 | |||
208 | |||
209 | # | ||
210 | # C | ||
211 | # | ||
212 | send -- "firejail --noprofile --net=eth0 --chroot=/tmp/chroot\r" | ||
213 | expect { | ||
214 | timeout {puts "TESTING ERROR 4\n";exit} | ||
215 | "Child process initialized" | ||
216 | } | ||
217 | sleep 1 | ||
218 | |||
219 | send -- "dig google.com\r" | ||
220 | expect { | ||
221 | timeout {puts "TESTING ERROR 5\n";exit} | ||
222 | "ANSWER SECTION" | ||
223 | } | ||
224 | expect { | ||
225 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
226 | "google.com" | ||
227 | } | ||
228 | expect { | ||
229 | timeout {puts "TESTING ERROR 5.2\n";exit} | ||
230 | "google.com" | ||
231 | } | ||
232 | expect { | ||
233 | timeout {puts "TESTING ERROR 5.3\n";exit} | ||
234 | "SERVER:" | ||
235 | } | ||
236 | after 100 | ||
237 | |||
238 | send -- "/sbin/ifconfig\r" | ||
239 | expect { | ||
240 | timeout {puts "TESTING ERROR 5.4\n";exit} | ||
241 | "eth0" | ||
242 | } | ||
243 | expect { | ||
244 | timeout {puts "TESTING ERROR 5.5\n";exit} | ||
245 | "Link" | ||
246 | } | ||
247 | expect { | ||
248 | timeout {puts "TESTING ERROR 5.6\n";exit} | ||
249 | "192.168.1" | ||
250 | } | ||
251 | expect { | ||
252 | timeout {puts "TESTING ERROR 5.7\n";exit} | ||
253 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
254 | } | ||
255 | after 100 | ||
256 | |||
257 | send -- "exit\r" | ||
258 | sleep 1 | ||
259 | |||
260 | send -- "firejail --noprofile --net=eth0 --ip=192.168.1.244 --chroot=/tmp/chroot\r" | ||
261 | expect { | ||
262 | timeout {puts "TESTING ERROR 4\n";exit} | ||
263 | "Child process initialized" | ||
264 | } | ||
265 | sleep 1 | ||
266 | |||
267 | send -- "dig google.com\r" | ||
268 | expect { | ||
269 | timeout {puts "TESTING ERROR 5\n";exit} | ||
270 | "ANSWER SECTION" | ||
271 | } | ||
272 | expect { | ||
273 | timeout {puts "TESTING ERROR 5.1\n";exit} | ||
274 | "google.com" | ||
275 | } | ||
276 | expect { | ||
277 | timeout {puts "TESTING ERROR 5.2\n";exit} | ||
278 | "google.com" | ||
279 | } | ||
280 | expect { | ||
281 | timeout {puts "TESTING ERROR 5.3\n";exit} | ||
282 | "SERVER:" | ||
283 | } | ||
284 | after 100 | ||
285 | |||
286 | send -- "/sbin/ifconfig\r" | ||
287 | expect { | ||
288 | timeout {puts "TESTING ERROR 5.4\n";exit} | ||
289 | "eth0" | ||
290 | } | ||
291 | expect { | ||
292 | timeout {puts "TESTING ERROR 5.5\n";exit} | ||
293 | "Link" | ||
294 | } | ||
295 | expect { | ||
296 | timeout {puts "TESTING ERROR 5.6\n";exit} | ||
297 | "192.168.1.244" | ||
298 | } | ||
299 | expect { | ||
300 | timeout {puts "TESTING ERROR 5.7\n";exit} | ||
301 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
302 | } | ||
303 | after 100 | ||
304 | |||
305 | send -- "exit\r" | ||
306 | sleep 1 | ||
307 | |||
308 | |||
309 | puts "\nall done\n" | ||
diff --git a/test/features/2.4.exp b/test/features/2.4.exp new file mode 100755 index 000000000..a995322b9 --- /dev/null +++ b/test/features/2.4.exp | |||
@@ -0,0 +1,232 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # | ||
3 | # bridge | ||
4 | # - todo: ping test or equivalent on chroot | ||
5 | # | ||
6 | |||
7 | set timeout 10 | ||
8 | spawn $env(SHELL) | ||
9 | match_max 100000 | ||
10 | |||
11 | # | ||
12 | # N | ||
13 | # | ||
14 | send -- "firejail --noprofile --net=br0\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 0\n";exit} | ||
17 | "Child process initialized" | ||
18 | } | ||
19 | sleep 1 | ||
20 | |||
21 | send -- "ping -c 3 10.10.20.1\r" | ||
22 | expect { | ||
23 | timeout {puts "TESTING ERROR 1\n";exit} | ||
24 | " packets transmitted, 3 received, 0% packet loss" | ||
25 | } | ||
26 | sleep 1 | ||
27 | |||
28 | |||
29 | send -- "/sbin/ifconfig\r" | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
32 | "eth0" | ||
33 | } | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 1.5n";exit} | ||
36 | "Link" | ||
37 | } | ||
38 | expect { | ||
39 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
40 | "10.10.20" | ||
41 | } | ||
42 | expect { | ||
43 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
44 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
45 | } | ||
46 | after 100 | ||
47 | |||
48 | send -- "exit\r" | ||
49 | sleep 1 | ||
50 | |||
51 | send -- "firejail --noprofile --net=br0 --ip=10.10.20.4\r" | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 0\n";exit} | ||
54 | "Child process initialized" | ||
55 | } | ||
56 | sleep 1 | ||
57 | |||
58 | send -- "ping -c 3 10.10.20.1\r" | ||
59 | expect { | ||
60 | timeout {puts "TESTING ERROR 1\n";exit} | ||
61 | " packets transmitted, 3 received, 0% packet loss" | ||
62 | } | ||
63 | sleep 1 | ||
64 | |||
65 | |||
66 | send -- "/sbin/ifconfig\r" | ||
67 | expect { | ||
68 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
69 | "eth0" | ||
70 | } | ||
71 | expect { | ||
72 | timeout {puts "TESTING ERROR 1.5n";exit} | ||
73 | "Link" | ||
74 | } | ||
75 | expect { | ||
76 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
77 | "10.10.20.4" | ||
78 | } | ||
79 | expect { | ||
80 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
81 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
82 | } | ||
83 | after 100 | ||
84 | |||
85 | send -- "exit\r" | ||
86 | sleep 1 | ||
87 | |||
88 | |||
89 | # | ||
90 | # O | ||
91 | # | ||
92 | send -- "firejail --noprofile --net=br0 --overlay\r" | ||
93 | expect { | ||
94 | timeout {puts "TESTING ERROR 2\n";exit} | ||
95 | "Child process initialized" | ||
96 | } | ||
97 | sleep 1 | ||
98 | |||
99 | send -- "ping -c 3 10.10.20.1\r" | ||
100 | expect { | ||
101 | timeout {puts "TESTING ERROR 3\n";exit} | ||
102 | " packets transmitted, 3 received, 0% packet loss" | ||
103 | } | ||
104 | sleep 1 | ||
105 | |||
106 | |||
107 | send -- "/sbin/ifconfig\r" | ||
108 | expect { | ||
109 | timeout {puts "TESTING ERROR 3.4\n";exit} | ||
110 | "eth0" | ||
111 | } | ||
112 | expect { | ||
113 | timeout {puts "TESTING ERROR 3.5\n";exit} | ||
114 | "Link" | ||
115 | } | ||
116 | expect { | ||
117 | timeout {puts "TESTING ERROR 3.6\n";exit} | ||
118 | "10.10.20" | ||
119 | } | ||
120 | expect { | ||
121 | timeout {puts "TESTING ERROR 3.7\n";exit} | ||
122 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
123 | } | ||
124 | after 100 | ||
125 | |||
126 | send -- "exit\r" | ||
127 | sleep 1 | ||
128 | |||
129 | send -- "firejail --noprofile --net=br0 --ip=10.10.20.4 --overlay\r" | ||
130 | expect { | ||
131 | timeout {puts "TESTING ERROR 2\n";exit} | ||
132 | "Child process initialized" | ||
133 | } | ||
134 | sleep 1 | ||
135 | |||
136 | send -- "ping -c 3 10.10.20.1\r" | ||
137 | expect { | ||
138 | timeout {puts "TESTING ERROR 3\n";exit} | ||
139 | " packets transmitted, 3 received, 0% packet loss" | ||
140 | } | ||
141 | sleep 1 | ||
142 | |||
143 | |||
144 | send -- "/sbin/ifconfig\r" | ||
145 | expect { | ||
146 | timeout {puts "TESTING ERROR 3.4\n";exit} | ||
147 | "eth0" | ||
148 | } | ||
149 | expect { | ||
150 | timeout {puts "TESTING ERROR 3.5\n";exit} | ||
151 | "Link" | ||
152 | } | ||
153 | expect { | ||
154 | timeout {puts "TESTING ERROR 3.6\n";exit} | ||
155 | "10.10.20.4" | ||
156 | } | ||
157 | expect { | ||
158 | timeout {puts "TESTING ERROR 3.7\n";exit} | ||
159 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
160 | } | ||
161 | after 100 | ||
162 | |||
163 | send -- "exit\r" | ||
164 | sleep 1 | ||
165 | |||
166 | |||
167 | |||
168 | # | ||
169 | # C | ||
170 | # | ||
171 | send -- "firejail --noprofile --net=br0 --chroot=/tmp/chroot\r" | ||
172 | expect { | ||
173 | timeout {puts "TESTING ERROR 4\n";exit} | ||
174 | "Child process initialized" | ||
175 | } | ||
176 | sleep 1 | ||
177 | |||
178 | send -- "/sbin/ifconfig\r" | ||
179 | expect { | ||
180 | timeout {puts "TESTING ERROR 5.4\n";exit} | ||
181 | "eth0" | ||
182 | } | ||
183 | expect { | ||
184 | timeout {puts "TESTING ERROR 5.5\n";exit} | ||
185 | "Link" | ||
186 | } | ||
187 | expect { | ||
188 | timeout {puts "TESTING ERROR 5.6\n";exit} | ||
189 | "10.10.20" | ||
190 | } | ||
191 | expect { | ||
192 | timeout {puts "TESTING ERROR 5.7\n";exit} | ||
193 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
194 | } | ||
195 | after 100 | ||
196 | |||
197 | send -- "exit\r" | ||
198 | sleep 1 | ||
199 | |||
200 | send -- "firejail --noprofile --net=br0 --ip=10.10.20.4 --chroot=/tmp/chroot\r" | ||
201 | expect { | ||
202 | timeout {puts "TESTING ERROR 4\n";exit} | ||
203 | "Child process initialized" | ||
204 | } | ||
205 | sleep 1 | ||
206 | |||
207 | send -- "/sbin/ifconfig\r" | ||
208 | expect { | ||
209 | timeout {puts "TESTING ERROR 5.4\n";exit} | ||
210 | "eth0" | ||
211 | } | ||
212 | expect { | ||
213 | timeout {puts "TESTING ERROR 5.5\n";exit} | ||
214 | "Link" | ||
215 | } | ||
216 | expect { | ||
217 | timeout {puts "TESTING ERROR 5.6\n";exit} | ||
218 | "10.10.20.4" | ||
219 | } | ||
220 | expect { | ||
221 | timeout {puts "TESTING ERROR 5.7\n";exit} | ||
222 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
223 | } | ||
224 | after 100 | ||
225 | |||
226 | send -- "exit\r" | ||
227 | sleep 1 | ||
228 | |||
229 | |||
230 | |||
231 | |||
232 | puts "\nall done\n" | ||
diff --git a/test/features/features.txt b/test/features/features.txt index 3342a1635..62f4d8adc 100644 --- a/test/features/features.txt +++ b/test/features/features.txt | |||
@@ -43,7 +43,7 @@ C - chroot filesystem | |||
43 | 43 | ||
44 | 2. Networking features | 44 | 2. Networking features |
45 | 45 | ||
46 | 2.1 Hostname (use --hostname=bingo, do a ping and cat /etc/hostname) | 46 | 2.1 Hostname (use --hostname=newhostname, do a ping and cat /etc/hostname) |
47 | - N, O, C | 47 | - N, O, C |
48 | - ping disabled for C by default seccomp filter, use "getent hosts bingo" | 48 | - ping disabled for C by default seccomp filter, use "getent hosts bingo" |
49 | 49 | ||
@@ -52,15 +52,14 @@ C - chroot filesystem | |||
52 | 52 | ||
53 | 2.3 mac-vlan (use --net=eth0 and --noprofile; run ifconfig and dig google.com) | 53 | 2.3 mac-vlan (use --net=eth0 and --noprofile; run ifconfig and dig google.com) |
54 | - N, O, C | 54 | - N, O, C |
55 | - test --ip: N, O, C | ||
55 | 56 | ||
56 | 2.4 bridge (use --net=br0 and --noprofile; run ifconfig, netstat -rn, ping default gw) | 57 | 2.4 bridge (use --net=br0 and --noprofile; run ifconfig, netstat -rn, ping default gw) |
57 | - N, O, C | 58 | - N, O, C |
58 | - ping disabled for C by default seccomp filter | 59 | - ping disabled for C by default seccomp filter - transfer test not implemented for C |
60 | - test --ip: N, O, C | ||
59 | 61 | ||
60 | 2.5 IP address (--noprofile --net=eth0 --ip=192.168.1.226 --net=br0 --ip=10.10.20.3, run ifconfig and netstat -rn) | 62 | 2.5 Default gw (--noprofile --net=eth0 --defaultgw=192.168.1.10, run netstat -rn) |
61 | - N, O, C | ||
62 | |||
63 | 2.6 Default gw (--noprofile --net=eth0 --defaultgw=192.168.1.10, run netstat -rn) | ||
64 | - N, O, C | 63 | - N, O, C |
65 | 64 | ||
66 | 65 | ||
diff --git a/test/features/test.sh b/test/features/test.sh index 341126a09..42b59f383 100755 --- a/test/features/test.sh +++ b/test/features/test.sh | |||
@@ -28,3 +28,15 @@ echo "TESTING: 1.8 disable /etc/firejail and ~/.config/firejail" | |||
28 | echo "TESTING: 1.10 disable /selinux" | 28 | echo "TESTING: 1.10 disable /selinux" |
29 | ./1.10.exp | 29 | ./1.10.exp |
30 | 30 | ||
31 | |||
32 | echo "TESTING: 2.1 hostname" | ||
33 | ./2.1.exp | ||
34 | |||
35 | echo "TESTING: 2.2 DNS" | ||
36 | ./2.2.exp | ||
37 | |||
38 | echo "TESTING: 2.3 mac-vlan" | ||
39 | ./2.3.exp | ||
40 | |||
41 | echo "TESTING: 2.4 bridge" | ||
42 | ./2.4.exp | ||