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