summaryrefslogtreecommitdiffstats
path: root/test/network/net_ip.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/network/net_ip.exp')
-rwxr-xr-xtest/network/net_ip.exp72
1 files changed, 72 insertions, 0 deletions
diff --git a/test/network/net_ip.exp b/test/network/net_ip.exp
new file mode 100755
index 000000000..f5d487ecc
--- /dev/null
+++ b/test/network/net_ip.exp
@@ -0,0 +1,72 @@
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\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}
29sleep 2
30send -- "exit\r"
31sleep 2
32
33# check loopback
34send -- "firejail --net=br0 --ip=10.10.20.5 --protocol=unix,inet,netlink\r"
35expect {
36 timeout {puts "TESTING ERROR 5\n";exit}
37 "lo"
38}
39expect {
40 timeout {puts "TESTING ERROR 6\n";exit}
41 "127.0.0.1"
42}
43expect {
44 timeout {puts "TESTING ERROR 7\n";exit}
45 "255.0.0.0"
46}
47expect {
48 timeout {puts "TESTING ERROR 8\n";exit}
49 "UP"
50}
51expect {
52 timeout {puts "TESTING ERROR 9\n";exit}
53 "Child process initialized"
54}
55sleep 1
56
57# check default gateway
58send -- "ip route show\r"
59expect {
60 timeout {puts "TESTING ERROR 10.1\n";exit}
61 "default via 10.10.20.1 dev eth0"
62}
63
64send -- "ip route show\r"
65expect {
66 timeout {puts "TESTING ERROR 10\n";exit}
67 "10.10.20.0/29 dev eth0 proto kernel scope link"
68}
69sleep 1
70
71puts "\n"
72