diff options
author | 2016-05-03 08:41:24 -0400 | |
---|---|---|
committer | 2016-05-03 08:41:24 -0400 | |
commit | 57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc (patch) | |
tree | 60f90718665a1a812b552f589bc4d85616232df1 /test/network/4bridges_arp.exp | |
parent | Merge branch 'master' of https://github.com/netblue30/firejail (diff) | |
download | firejail-57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc.tar.gz firejail-57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc.tar.zst firejail-57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc.zip |
networking features testing
Diffstat (limited to 'test/network/4bridges_arp.exp')
-rwxr-xr-x | test/network/4bridges_arp.exp | 170 |
1 files changed, 170 insertions, 0 deletions
diff --git a/test/network/4bridges_arp.exp b/test/network/4bridges_arp.exp new file mode 100755 index 000000000..6a3e6db2a --- /dev/null +++ b/test/network/4bridges_arp.exp | |||
@@ -0,0 +1,170 @@ | |||
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 --net=br2 --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 --net=br2 --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" | ||
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 --net=br2 --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" | ||
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 --net=br2 --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 --net=br2 --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 | sleep 1 | ||
140 | |||
141 | # check default gateway | ||
142 | send -- "ip route show\r" | ||
143 | expect { | ||
144 | timeout {puts "TESTING ERROR 10.1\n";exit} | ||
145 | "default via 10.10.20.1 dev eth0" | ||
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 | send -- "ip route show\r" | ||
153 | expect { | ||
154 | timeout {puts "TESTING ERROR 10.2\n";exit} | ||
155 | "10.10.30.0/24 dev eth1 proto kernel scope link" | ||
156 | } | ||
157 | send -- "ip route show\r" | ||
158 | expect { | ||
159 | timeout {puts "TESTING ERROR 10.2\n";exit} | ||
160 | "10.10.40.0/24 dev eth2 proto kernel scope link" | ||
161 | } | ||
162 | send -- "ip route show\r" | ||
163 | expect { | ||
164 | timeout {puts "TESTING ERROR 10.2\n";exit} | ||
165 | "10.10.50.0/24 dev eth3 proto kernel scope link" | ||
166 | } | ||
167 | sleep 1 | ||
168 | |||
169 | puts "\nall done\n" | ||
170 | |||