summaryrefslogtreecommitdiffstats
path: root/test/network/net_interface.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/network/net_interface.exp')
-rwxr-xr-xtest/network/net_interface.exp88
1 files changed, 88 insertions, 0 deletions
diff --git a/test/network/net_interface.exp b/test/network/net_interface.exp
new file mode 100755
index 000000000..4b55187ff
--- /dev/null
+++ b/test/network/net_interface.exp
@@ -0,0 +1,88 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "ip link add link eth0 name eth0.100 type vlan id 100\r"
8sleep 1
9send -- "ip link add link eth0 name eth0.101 type vlan id 101\r"
10sleep 1
11send -- "ip link add link eth0 name eth0.102 type vlan id 102\r"
12sleep 1
13send -- "ip link add link eth0 name eth0.103 type vlan id 103\r"
14sleep 1
15send -- "ip link add link eth0 name eth0.104 type vlan id 104\r"
16sleep 1
17puts "\n"
18
19send -- "/sbin/ifconfig eth0.100 10.200.0.1/24\r"
20sleep 1
21send -- "/sbin/ifconfig eth0.101 10.200.1.1/24\r"
22sleep 1
23send -- "/sbin/ifconfig eth0.102 10.200.2.1/24\r"
24sleep 1
25send -- "/sbin/ifconfig eth0.103 10.200.3.1/24\r"
26sleep 1
27send -- "/sbin/ifconfig eth0.104 10.200.4.1/24\r"
28sleep 1
29puts "\n"
30
31
32
33send -- "firejail --noprofile --interface=eth0.100 --interface=eth0.101 --interface=eth0.102 --interface=eth0.103 --interface=eth0.104\r"
34expect {
35 timeout {puts "TESTING ERROR 0\n";exit}
36 "maximum 4 interfaces are allowed"
37}
38sleep 1
39
40send -- "firejail --noprofile --interface=eth0.100 --interface=eth0.101 --interface=eth0.102 --interface=eth0.103\r"
41expect {
42 timeout {puts "TESTING ERROR 1\n";exit}
43 "eth0.100"
44}
45expect {
46 timeout {puts "TESTING ERROR 1.1\n";exit}
47 "UP"
48}
49expect {
50 timeout {puts "TESTING ERROR 2\n";exit}
51 "eth0.101"
52}
53expect {
54 timeout {puts "TESTING ERROR 2.2\n";exit}
55 "UP"
56}
57expect {
58 timeout {puts "TESTING ERROR 3\n";exit}
59 "eth0.102"
60}
61expect {
62 timeout {puts "TESTING ERROR 3.1\n";exit}
63 "UP"
64}
65expect {
66 timeout {puts "TESTING ERROR 4\n";exit}
67 "eth0.103"
68}
69expect {
70 timeout {puts "TESTING ERROR 4.1\n";exit}
71 "UP"
72}
73sleep 1
74send -- "exit\r"
75sleep 1
76
77send -- "firejail --noprofile --interface=eth0.104\r"
78expect {
79 timeout {puts "TESTING ERROR 5\n";exit}
80 "eth0.104"
81}
82expect {
83 timeout {puts "TESTING ERROR 5.1\n";exit}
84 "UP"
85}
86
87puts "all done\n"
88