aboutsummaryrefslogtreecommitdiffstats
path: root/test/network/net_defaultgw.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/network/net_defaultgw.exp')
-rwxr-xr-xtest/network/net_defaultgw.exp50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/network/net_defaultgw.exp b/test/network/net_defaultgw.exp
new file mode 100755
index 000000000..6291ae5ba
--- /dev/null
+++ b/test/network/net_defaultgw.exp
@@ -0,0 +1,50 @@
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
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10# check ip address
11send -- "firejail --net=br0 --ip=10.10.20.5 --defaultgw=10.10.20.2 --protocol=unix,inet,netlink\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 "eth0"
15}
16expect {
17 timeout {puts "TESTING ERROR 1\n";exit}
18 "10.10.20.5"
19}
20expect {
21 timeout {puts "TESTING ERROR 2\n";exit}
22 "255.255.255.248"
23}
24expect {
25 timeout {puts "TESTING ERROR 3\n";exit}
26 "UP"
27}
28expect {
29 timeout {puts "TESTING ERROR 4\n";exit}
30 "Child process initialized"
31}
32sleep 1
33
34# check default gateway
35send -- "ip route show\r"
36expect {
37 timeout {puts "TESTING ERROR 10.1\n";exit}
38 "default via 10.10.20.2 dev eth0"
39}
40
41send -- "ip route show\r"
42expect {
43 timeout {puts "TESTING ERROR 10.2\n";exit}
44 "10.10.20.0/29 dev eth0 proto kernel scope link"
45}
46send -- "exit\r"
47after 100
48
49puts "\nall done\n"
50