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