diff options
Diffstat (limited to 'test/network/4bridges_ip.exp')
-rwxr-xr-x | test/network/4bridges_ip.exp | 174 |
1 files changed, 174 insertions, 0 deletions
diff --git a/test/network/4bridges_ip.exp b/test/network/4bridges_ip.exp new file mode 100755 index 000000000..8068aeebb --- /dev/null +++ b/test/network/4bridges_ip.exp | |||
@@ -0,0 +1,174 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | # check eth0 | ||
8 | send -- "firejail --net=br0 --net=br1 --ip=10.10.30.50 --net=br2 --ip=10.10.40.100 --net=br3\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0.0\n";exit} | ||
11 | "eth0" | ||
12 | } | ||
13 | expect { | ||
14 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
15 | "10.10.20" | ||
16 | } | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 0.2\n";exit} | ||
19 | "255.255.255.248" | ||
20 | } | ||
21 | expect { | ||
22 | timeout {puts "TESTING ERROR 0.3\n";exit} | ||
23 | "UP" | ||
24 | } | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 0.4\n";exit} | ||
27 | "Child process initialized" | ||
28 | } | ||
29 | sleep 2 | ||
30 | send -- "exit\r" | ||
31 | sleep 2 | ||
32 | |||
33 | # check eth1 | ||
34 | send -- "firejail --net=br0 --net=br1 --ip=10.10.30.50 --net=br2 --ip=10.10.40.100 --net=br3\r" | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 1.0\n";exit} | ||
37 | "eth1" | ||
38 | } | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 1.1\n";exit} | ||
41 | "10.10.30.50" | ||
42 | } | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 1.2\n";exit} | ||
45 | "255.255.255.0" | ||
46 | } | ||
47 | expect { | ||
48 | timeout {puts "TESTING ERROR 1.3\n";exit} | ||
49 | "UP" | ||
50 | } | ||
51 | expect { | ||
52 | timeout {puts "TESTING ERROR 1.4\n";exit} | ||
53 | "Child process initialized" | ||
54 | } | ||
55 | sleep 2 | ||
56 | send -- "exit\r" | ||
57 | sleep 2 | ||
58 | |||
59 | |||
60 | # check eth2 | ||
61 | send -- "firejail --net=br0 --net=br1 --ip=10.10.30.50 --net=br2 --ip=10.10.40.100 --net=br3\r" | ||
62 | expect { | ||
63 | timeout {puts "TESTING ERROR 2.0\n";exit} | ||
64 | "eth2" | ||
65 | } | ||
66 | expect { | ||
67 | timeout {puts "TESTING ERROR 2.1\n";exit} | ||
68 | "10.10.40.100" | ||
69 | } | ||
70 | expect { | ||
71 | timeout {puts "TESTING ERROR 2.2\n";exit} | ||
72 | "255.255.255.0" | ||
73 | } | ||
74 | expect { | ||
75 | timeout {puts "TESTING ERROR 2.3\n";exit} | ||
76 | "UP" | ||
77 | } | ||
78 | expect { | ||
79 | timeout {puts "TESTING ERROR 2.4\n";exit} | ||
80 | "Child process initialized" | ||
81 | } | ||
82 | sleep 2 | ||
83 | send -- "exit\r" | ||
84 | sleep 2 | ||
85 | |||
86 | |||
87 | |||
88 | # check eth3 | ||
89 | send -- "firejail --net=br0 --net=br1 --ip=10.10.30.50 --net=br2 --ip=10.10.40.100 --net=br3\r" | ||
90 | expect { | ||
91 | timeout {puts "TESTING ERROR 3.0\n";exit} | ||
92 | "eth3" | ||
93 | } | ||
94 | expect { | ||
95 | timeout {puts "TESTING ERROR 3.1\n";exit} | ||
96 | "10.10.50" | ||
97 | } | ||
98 | expect { | ||
99 | timeout {puts "TESTING ERROR 3.2\n";exit} | ||
100 | "255.255.255.0" | ||
101 | } | ||
102 | expect { | ||
103 | timeout {puts "TESTING ERROR 3.3\n";exit} | ||
104 | "UP" | ||
105 | } | ||
106 | expect { | ||
107 | timeout {puts "TESTING ERROR 4\n";exit} | ||
108 | "Child process initialized" | ||
109 | } | ||
110 | sleep 2 | ||
111 | send -- "exit\r" | ||
112 | sleep 2 | ||
113 | |||
114 | |||
115 | |||
116 | |||
117 | # check loopback | ||
118 | send -- "firejail --net=br0 --net=br1 --ip=10.10.30.50 --net=br2 --ip=10.10.40.100 --net=br3 --protocol=unix,inet,netlink\r" | ||
119 | expect { | ||
120 | timeout {puts "TESTING ERROR 5\n";exit} | ||
121 | "lo" | ||
122 | } | ||
123 | expect { | ||
124 | timeout {puts "TESTING ERROR 6\n";exit} | ||
125 | "127.0.0.1" | ||
126 | } | ||
127 | expect { | ||
128 | timeout {puts "TESTING ERROR 7\n";exit} | ||
129 | "255.0.0.0" | ||
130 | } | ||
131 | expect { | ||
132 | timeout {puts "TESTING ERROR 8\n";exit} | ||
133 | "UP" | ||
134 | } | ||
135 | expect { | ||
136 | timeout {puts "TESTING ERROR 9\n";exit} | ||
137 | "Child process initialized" | ||
138 | } | ||
139 | |||
140 | # check default gateway | ||
141 | send -- "ip route show\r" | ||
142 | expect { | ||
143 | timeout {puts "TESTING ERROR 10.1\n";exit} | ||
144 | "default via 10.10.20.1 dev eth0" | ||
145 | } | ||
146 | |||
147 | send -- "ip route show\r" | ||
148 | expect { | ||
149 | timeout {puts "TESTING ERROR 10.2\n";exit} | ||
150 | "10.10.20.0/29 dev eth0 proto kernel scope link" | ||
151 | } | ||
152 | |||
153 | send -- "ip route show\r" | ||
154 | expect { | ||
155 | timeout {puts "TESTING ERROR 10.3\n";exit} | ||
156 | "10.10.30.0/24 dev eth1 proto kernel scope link src 10.10.30.50" | ||
157 | } | ||
158 | |||
159 | send -- "ip route show\r" | ||
160 | expect { | ||
161 | timeout {puts "TESTING ERROR 10.4\n";exit} | ||
162 | "10.10.40.0/24 dev eth2 proto kernel scope link src 10.10.40.100" | ||
163 | } | ||
164 | |||
165 | send -- "ip route show\r" | ||
166 | expect { | ||
167 | timeout {puts "TESTING ERROR 10.5\n";exit} | ||
168 | "10.10.50.0/24 dev eth3 proto kernel scope link" | ||
169 | } | ||
170 | |||
171 | sleep 1 | ||
172 | |||
173 | puts "\nall done\n" | ||
174 | |||