aboutsummaryrefslogtreecommitdiffstats
path: root/test/network/net_defaultgw2.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/network/net_defaultgw2.exp')
-rwxr-xr-xtest/network/net_defaultgw2.exp44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/network/net_defaultgw2.exp b/test/network/net_defaultgw2.exp
new file mode 100755
index 000000000..7620e4899
--- /dev/null
+++ b/test/network/net_defaultgw2.exp
@@ -0,0 +1,44 @@
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 --net=br1 --defaultgw=10.10.30.89 --protocol=unix,inet,netlink\r"
12expect {
13 timeout {puts "TESTING ERROR 0\n";exit}
14 "eth1"
15}
16expect {
17 timeout {puts "TESTING ERROR 4\n";exit}
18 "Child process initialized"
19}
20sleep 1
21
22# check default gateway
23send -- "ip route show\r"
24expect {
25 timeout {puts "TESTING ERROR 10.1\n";exit}
26 "default via 10.10.30.89 dev eth1"
27}
28
29send -- "ip route show\r"
30expect {
31 timeout {puts "TESTING ERROR 10.2\n";exit}
32 "10.10.20.0/29 dev eth0 proto kernel scope link"
33}
34
35send -- "ip route show\r"
36expect {
37 timeout {puts "TESTING ERROR 10.3\n";exit}
38 "10.10.30.0/24 dev eth1 proto kernel scope link"
39}
40send -- "exit\r"
41after 100
42
43puts "\nall done\n"
44