aboutsummaryrefslogtreecommitdiffstats
path: root/test/net_defaultgw.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/net_defaultgw.exp')
-rwxr-xr-xtest/net_defaultgw.exp65
1 files changed, 65 insertions, 0 deletions
diff --git a/test/net_defaultgw.exp b/test/net_defaultgw.exp
new file mode 100755
index 000000000..9820660b7
--- /dev/null
+++ b/test/net_defaultgw.exp
@@ -0,0 +1,65 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# check ip address
8send -- "firejail --net=br0 --ip=10.10.20.5 --defaultgw=10.10.20.2\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "eth0"
12}
13expect {
14 timeout {puts "TESTING ERROR 1\n";exit}
15 "10.10.20.5"
16}
17expect {
18 timeout {puts "TESTING ERROR 2\n";exit}
19 "255.255.255.248"
20}
21expect {
22 timeout {puts "TESTING ERROR 3\n";exit}
23 "UP"
24}
25expect {
26 timeout {puts "TESTING ERROR 4\n";exit}
27 "Child process initialized"
28}
29
30# check default gateway
31send -- "bash\r"
32sleep 1
33send -- "netstat -rn;pwd\r"
34expect {
35 timeout {puts "TESTING ERROR 10.1\n";exit}
36 "0.0.0.0"
37}
38expect {
39 timeout {puts "TESTING ERROR 10.2\n";exit}
40 "10.10.20.2"
41}
42expect {
43 timeout {puts "TESTING ERROR 10.3\n";exit}
44 "eth0"
45}
46expect {
47 timeout {puts "TESTING ERROR 10.4\n";exit}
48 "10.10.20.0"
49}
50expect {
51 timeout {puts "TESTING ERROR 10.5\n";exit}
52 "0.0.0.0"
53}
54expect {
55 timeout {puts "TESTING ERROR 10.6\n";exit}
56 "eth0"
57}
58expect {
59 timeout {puts "TESTING ERROR 10\n";exit}
60 "home"
61}
62sleep 1
63
64puts "\n"
65