aboutsummaryrefslogtreecommitdiffstats
path: root/test/network/4bridges_ip.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-05-03 08:41:24 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-05-03 08:41:24 -0400
commit57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc (patch)
tree60f90718665a1a812b552f589bc4d85616232df1 /test/network/4bridges_ip.exp
parentMerge branch 'master' of https://github.com/netblue30/firejail (diff)
downloadfirejail-57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc.tar.gz
firejail-57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc.tar.zst
firejail-57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc.zip
networking features testing
Diffstat (limited to 'test/network/4bridges_ip.exp')
-rwxr-xr-xtest/network/4bridges_ip.exp174
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
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# check eth0
8send -- "firejail --net=br0 --net=br1 --ip=10.10.30.50 --net=br2 --ip=10.10.40.100 --net=br3\r"
9expect {
10 timeout {puts "TESTING ERROR 0.0\n";exit}
11 "eth0"
12}
13expect {
14 timeout {puts "TESTING ERROR 0.1\n";exit}
15 "10.10.20"
16}
17expect {
18 timeout {puts "TESTING ERROR 0.2\n";exit}
19 "255.255.255.248"
20}
21expect {
22 timeout {puts "TESTING ERROR 0.3\n";exit}
23 "UP"
24}
25expect {
26 timeout {puts "TESTING ERROR 0.4\n";exit}
27 "Child process initialized"
28}
29sleep 2
30send -- "exit\r"
31sleep 2
32
33# check eth1
34send -- "firejail --net=br0 --net=br1 --ip=10.10.30.50 --net=br2 --ip=10.10.40.100 --net=br3\r"
35expect {
36 timeout {puts "TESTING ERROR 1.0\n";exit}
37 "eth1"
38}
39expect {
40 timeout {puts "TESTING ERROR 1.1\n";exit}
41 "10.10.30.50"
42}
43expect {
44 timeout {puts "TESTING ERROR 1.2\n";exit}
45 "255.255.255.0"
46}
47expect {
48 timeout {puts "TESTING ERROR 1.3\n";exit}
49 "UP"
50}
51expect {
52 timeout {puts "TESTING ERROR 1.4\n";exit}
53 "Child process initialized"
54}
55sleep 2
56send -- "exit\r"
57sleep 2
58
59
60# check eth2
61send -- "firejail --net=br0 --net=br1 --ip=10.10.30.50 --net=br2 --ip=10.10.40.100 --net=br3\r"
62expect {
63 timeout {puts "TESTING ERROR 2.0\n";exit}
64 "eth2"
65}
66expect {
67 timeout {puts "TESTING ERROR 2.1\n";exit}
68 "10.10.40.100"
69}
70expect {
71 timeout {puts "TESTING ERROR 2.2\n";exit}
72 "255.255.255.0"
73}
74expect {
75 timeout {puts "TESTING ERROR 2.3\n";exit}
76 "UP"
77}
78expect {
79 timeout {puts "TESTING ERROR 2.4\n";exit}
80 "Child process initialized"
81}
82sleep 2
83send -- "exit\r"
84sleep 2
85
86
87
88# check eth3
89send -- "firejail --net=br0 --net=br1 --ip=10.10.30.50 --net=br2 --ip=10.10.40.100 --net=br3\r"
90expect {
91 timeout {puts "TESTING ERROR 3.0\n";exit}
92 "eth3"
93}
94expect {
95 timeout {puts "TESTING ERROR 3.1\n";exit}
96 "10.10.50"
97}
98expect {
99 timeout {puts "TESTING ERROR 3.2\n";exit}
100 "255.255.255.0"
101}
102expect {
103 timeout {puts "TESTING ERROR 3.3\n";exit}
104 "UP"
105}
106expect {
107 timeout {puts "TESTING ERROR 4\n";exit}
108 "Child process initialized"
109}
110sleep 2
111send -- "exit\r"
112sleep 2
113
114
115
116
117# check loopback
118send -- "firejail --net=br0 --net=br1 --ip=10.10.30.50 --net=br2 --ip=10.10.40.100 --net=br3 --protocol=unix,inet,netlink\r"
119expect {
120 timeout {puts "TESTING ERROR 5\n";exit}
121 "lo"
122}
123expect {
124 timeout {puts "TESTING ERROR 6\n";exit}
125 "127.0.0.1"
126}
127expect {
128 timeout {puts "TESTING ERROR 7\n";exit}
129 "255.0.0.0"
130}
131expect {
132 timeout {puts "TESTING ERROR 8\n";exit}
133 "UP"
134}
135expect {
136 timeout {puts "TESTING ERROR 9\n";exit}
137 "Child process initialized"
138}
139
140# check default gateway
141send -- "ip route show\r"
142expect {
143 timeout {puts "TESTING ERROR 10.1\n";exit}
144 "default via 10.10.20.1 dev eth0"
145}
146
147send -- "ip route show\r"
148expect {
149 timeout {puts "TESTING ERROR 10.2\n";exit}
150 "10.10.20.0/29 dev eth0 proto kernel scope link"
151}
152
153send -- "ip route show\r"
154expect {
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
159send -- "ip route show\r"
160expect {
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
165send -- "ip route show\r"
166expect {
167 timeout {puts "TESTING ERROR 10.5\n";exit}
168 "10.10.50.0/24 dev eth3 proto kernel scope link"
169}
170
171sleep 1
172
173puts "\nall done\n"
174