aboutsummaryrefslogtreecommitdiffstats
path: root/test/network/net_profile.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/network/net_profile.exp')
-rwxr-xr-xtest/network/net_profile.exp77
1 files changed, 77 insertions, 0 deletions
diff --git a/test/network/net_profile.exp b/test/network/net_profile.exp
new file mode 100755
index 000000000..29008d811
--- /dev/null
+++ b/test/network/net_profile.exp
@@ -0,0 +1,77 @@
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 eth0
11send -- "firejail --profile=net-profile.profile\r"
12expect {
13 timeout {puts "TESTING ERROR 0.0\n";exit}
14 "eth0"
15}
16expect {
17 timeout {puts "TESTING ERROR 0.1\n";exit}
18 "00:11:22:33:44:55"
19}
20expect {
21 timeout {puts "TESTING ERROR 0.1\n";exit}
22 "10.10.20"
23}
24expect {
25 timeout {puts "TESTING ERROR 0.2\n";exit}
26 "255.255.255.248"
27}
28expect {
29 timeout {puts "TESTING ERROR 0.3\n";exit}
30 "UP"
31}
32expect {
33 timeout {puts "TESTING ERROR 0.4\n";exit}
34 "Child process initialized"
35}
36sleep 1
37
38send -- "ip route show\r"
39expect {
40 timeout {puts "TESTING ERROR 1\n";exit}
41 "10.10.30.0/24 dev eth1 proto kernel scope link src 10.10.30.50"
42}
43
44send -- "ip route show\r"
45expect {
46 timeout {puts "TESTING ERROR 2\n";exit}
47 "10.10.40.0/24 dev eth2 proto kernel scope link src 10.10.40.100"
48}
49
50
51# check default gw
52send -- "ip route show\r"
53expect {
54 timeout {puts "TESTING ERROR 3\n";exit}
55 "default via 10.10.20.2 dev eth0"
56}
57
58# check mtu
59send -- "ip link show\r"
60expect {
61 timeout {puts "TESTING ERROR 4\n";exit}
62 "eth0"
63}
64expect {
65 timeout {puts "TESTING ERROR 5\n";exit}
66 "mtu 1000"
67}
68expect {
69 timeout {puts "TESTING ERROR 6\n";exit}
70 "state UP"
71}
72
73send -- "exit\r"
74after 100
75
76puts "\nall done\n"
77