diff options
author | 2023-02-28 09:51:26 -0500 | |
---|---|---|
committer | 2023-02-28 09:51:26 -0500 | |
commit | 27c4d069f322fbeca07c88e0e96208233103a5db (patch) | |
tree | fb4b4fdc75eb5e633ab55b8228a60f54176446a0 /test/features/2.4.exp | |
parent | fix cppcheck/scan-build problems (diff) | |
download | firejail-27c4d069f322fbeca07c88e0e96208233103a5db.tar.gz firejail-27c4d069f322fbeca07c88e0e96208233103a5db.tar.zst firejail-27c4d069f322fbeca07c88e0e96208233103a5db.zip |
chroot testing
Diffstat (limited to 'test/features/2.4.exp')
-rwxr-xr-x | test/features/2.4.exp | 239 |
1 files changed, 0 insertions, 239 deletions
diff --git a/test/features/2.4.exp b/test/features/2.4.exp deleted file mode 100755 index ed52f4bad..000000000 --- a/test/features/2.4.exp +++ /dev/null | |||
@@ -1,239 +0,0 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | # This file is part of Firejail project | ||
3 | # Copyright (C) 2014-2023 Firejail Authors | ||
4 | # License GPL v2 | ||
5 | # | ||
6 | # bridge | ||
7 | # - todo: ping test or equivalent on chroot | ||
8 | # | ||
9 | |||
10 | set timeout 10 | ||
11 | spawn $env(SHELL) | ||
12 | match_max 100000 | ||
13 | set overlay [lindex $argv 0] | ||
14 | set chroot [lindex $argv 1] | ||
15 | |||
16 | # | ||
17 | # N | ||
18 | # | ||
19 | send -- "firejail --noprofile --net=br0\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 0\n";exit} | ||
22 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
23 | } | ||
24 | sleep 1 | ||
25 | |||
26 | send -- "ping -c 3 10.10.20.1\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 1\n";exit} | ||
29 | " packets transmitted, 3 received, 0% packet loss" | ||
30 | } | ||
31 | sleep 1 | ||
32 | |||
33 | |||
34 | send -- "/sbin/ifconfig\r" | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
37 | "eth0" | ||
38 | } | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 1.5n";exit} | ||
41 | "Link" | ||
42 | } | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
45 | "10.10.20" | ||
46 | } | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
49 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
50 | } | ||
51 | after 100 | ||
52 | |||
53 | send -- "exit\r" | ||
54 | sleep 1 | ||
55 | |||
56 | send -- "firejail --noprofile --net=br0 --ip=10.10.20.4\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 0\n";exit} | ||
59 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
60 | } | ||
61 | sleep 1 | ||
62 | |||
63 | send -- "ping -c 3 10.10.20.1\r" | ||
64 | expect { | ||
65 | timeout {puts "TESTING ERROR 1\n";exit} | ||
66 | " packets transmitted, 3 received, 0% packet loss" | ||
67 | } | ||
68 | sleep 1 | ||
69 | |||
70 | |||
71 | send -- "/sbin/ifconfig\r" | ||
72 | expect { | ||
73 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
74 | "eth0" | ||
75 | } | ||
76 | expect { | ||
77 | timeout {puts "TESTING ERROR 1.5n";exit} | ||
78 | "Link" | ||
79 | } | ||
80 | expect { | ||
81 | timeout {puts "TESTING ERROR 1.6\n";exit} | ||
82 | "10.10.20.4" | ||
83 | } | ||
84 | expect { | ||
85 | timeout {puts "TESTING ERROR 1.7\n";exit} | ||
86 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
87 | } | ||
88 | after 100 | ||
89 | |||
90 | send -- "exit\r" | ||
91 | sleep 1 | ||
92 | |||
93 | |||
94 | # | ||
95 | # O | ||
96 | # | ||
97 | if { $overlay == "overlay" } { | ||
98 | send -- "firejail --noprofile --net=br0 --overlay\r" | ||
99 | expect { | ||
100 | timeout {puts "TESTING ERROR 2\n";exit} | ||
101 | "overlay option is not available" {puts "grsecurity\n"; exit} | ||
102 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" {puts "normal system\n"} | ||
103 | } | ||
104 | sleep 1 | ||
105 | |||
106 | send -- "ping -c 3 10.10.20.1\r" | ||
107 | expect { | ||
108 | timeout {puts "TESTING ERROR 3\n";exit} | ||
109 | " packets transmitted, 3 received, 0% packet loss" | ||
110 | } | ||
111 | sleep 1 | ||
112 | |||
113 | |||
114 | send -- "/sbin/ifconfig\r" | ||
115 | expect { | ||
116 | timeout {puts "TESTING ERROR 3.4\n";exit} | ||
117 | "eth0" | ||
118 | } | ||
119 | expect { | ||
120 | timeout {puts "TESTING ERROR 3.5\n";exit} | ||
121 | "Link" | ||
122 | } | ||
123 | expect { | ||
124 | timeout {puts "TESTING ERROR 3.6\n";exit} | ||
125 | "10.10.20" | ||
126 | } | ||
127 | expect { | ||
128 | timeout {puts "TESTING ERROR 3.7\n";exit} | ||
129 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
130 | } | ||
131 | after 100 | ||
132 | |||
133 | send -- "exit\r" | ||
134 | sleep 1 | ||
135 | |||
136 | send -- "firejail --noprofile --net=br0 --ip=10.10.20.4 --overlay\r" | ||
137 | expect { | ||
138 | timeout {puts "TESTING ERROR 2\n";exit} | ||
139 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
140 | } | ||
141 | sleep 1 | ||
142 | |||
143 | send -- "ping -c 3 10.10.20.1\r" | ||
144 | expect { | ||
145 | timeout {puts "TESTING ERROR 3\n";exit} | ||
146 | " packets transmitted, 3 received, 0% packet loss" | ||
147 | } | ||
148 | sleep 1 | ||
149 | |||
150 | |||
151 | send -- "/sbin/ifconfig\r" | ||
152 | expect { | ||
153 | timeout {puts "TESTING ERROR 3.4\n";exit} | ||
154 | "eth0" | ||
155 | } | ||
156 | expect { | ||
157 | timeout {puts "TESTING ERROR 3.5\n";exit} | ||
158 | "Link" | ||
159 | } | ||
160 | expect { | ||
161 | timeout {puts "TESTING ERROR 3.6\n";exit} | ||
162 | "10.10.20.4" | ||
163 | } | ||
164 | expect { | ||
165 | timeout {puts "TESTING ERROR 3.7\n";exit} | ||
166 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
167 | } | ||
168 | after 100 | ||
169 | |||
170 | send -- "exit\r" | ||
171 | sleep 1 | ||
172 | } | ||
173 | |||
174 | |||
175 | # | ||
176 | # C | ||
177 | # | ||
178 | if { $chroot == "chroot" } { | ||
179 | send -- "firejail --noprofile --net=br0 --chroot=/tmp/chroot\r" | ||
180 | expect { | ||
181 | timeout {puts "TESTING ERROR 4\n";exit} | ||
182 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
183 | } | ||
184 | sleep 1 | ||
185 | |||
186 | send -- "/sbin/ifconfig\r" | ||
187 | expect { | ||
188 | timeout {puts "TESTING ERROR 5.4\n";exit} | ||
189 | "eth0" | ||
190 | } | ||
191 | expect { | ||
192 | timeout {puts "TESTING ERROR 5.5\n";exit} | ||
193 | "Link" | ||
194 | } | ||
195 | expect { | ||
196 | timeout {puts "TESTING ERROR 5.6\n";exit} | ||
197 | "10.10.20" | ||
198 | } | ||
199 | expect { | ||
200 | timeout {puts "TESTING ERROR 5.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 | send -- "firejail --noprofile --net=br0 --ip=10.10.20.4 --chroot=/tmp/chroot\r" | ||
209 | expect { | ||
210 | timeout {puts "TESTING ERROR 4\n";exit} | ||
211 | -re "Child process initialized in \[0-9\]+.\[0-9\]+ ms" | ||
212 | } | ||
213 | sleep 1 | ||
214 | |||
215 | send -- "/sbin/ifconfig\r" | ||
216 | expect { | ||
217 | timeout {puts "TESTING ERROR 5.4\n";exit} | ||
218 | "eth0" | ||
219 | } | ||
220 | expect { | ||
221 | timeout {puts "TESTING ERROR 5.5\n";exit} | ||
222 | "Link" | ||
223 | } | ||
224 | expect { | ||
225 | timeout {puts "TESTING ERROR 5.6\n";exit} | ||
226 | "10.10.20.4" | ||
227 | } | ||
228 | expect { | ||
229 | timeout {puts "TESTING ERROR 5.7\n";exit} | ||
230 | "UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1" | ||
231 | } | ||
232 | after 100 | ||
233 | |||
234 | send -- "exit\r" | ||
235 | sleep 1 | ||
236 | } | ||
237 | |||
238 | |||
239 | puts "\nall done\n" | ||