diff options
Diffstat (limited to 'test/features/2.4.exp')
-rwxr-xr-x | test/features/2.4.exp | 232 |
1 files changed, 232 insertions, 0 deletions
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" | ||