aboutsummaryrefslogtreecommitdiffstats
path: root/test/4bridges_ip.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-08-08 19:12:30 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2015-08-08 19:12:30 -0400
commit1379851360349d6617ad32944a25ee5e2bb74fc2 (patch)
treef69b48e90708bfa3c2723d5a27ed3e024c827b43 /test/4bridges_ip.exp
parentdelete files (diff)
downloadfirejail-1379851360349d6617ad32944a25ee5e2bb74fc2.tar.gz
firejail-1379851360349d6617ad32944a25ee5e2bb74fc2.tar.zst
firejail-1379851360349d6617ad32944a25ee5e2bb74fc2.zip
Baseline firejail 0.9.28
Diffstat (limited to 'test/4bridges_ip.exp')
-rwxr-xr-xtest/4bridges_ip.exp175
1 files changed, 175 insertions, 0 deletions
diff --git a/test/4bridges_ip.exp b/test/4bridges_ip.exp
new file mode 100755
index 000000000..9e37b4ff4
--- /dev/null
+++ b/test/4bridges_ip.exp
@@ -0,0 +1,175 @@
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\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 -- "bash\r"
142sleep 1
143send -- "netstat -rn;pwd\r"
144expect {
145 timeout {puts "TESTING ERROR 10.1\n";exit}
146 "0.0.0.0"
147}
148expect {
149 timeout {puts "TESTING ERROR 10.2\n";exit}
150 "10.10.20.1"
151}
152expect {
153 timeout {puts "TESTING ERROR 10.3\n";exit}
154 "eth0"
155}
156expect {
157 timeout {puts "TESTING ERROR 10.4\n";exit}
158 "10.10.20.0"
159}
160expect {
161 timeout {puts "TESTING ERROR 10.5\n";exit}
162 "0.0.0.0"
163}
164expect {
165 timeout {puts "TESTING ERROR 10.6\n";exit}
166 "eth0"
167}
168expect {
169 timeout {puts "TESTING ERROR 10\n";exit}
170 "home"
171}
172sleep 1
173
174puts "\n"
175