diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/net-profile.profile | 10 | ||||
-rwxr-xr-x | test/net_profile.exp | 73 | ||||
-rwxr-xr-x | test/test.sh | 3 |
3 files changed, 86 insertions, 0 deletions
diff --git a/test/net-profile.profile b/test/net-profile.profile new file mode 100644 index 000000000..05052b6dc --- /dev/null +++ b/test/net-profile.profile | |||
@@ -0,0 +1,10 @@ | |||
1 | net br0 | ||
2 | mac 00:11:22:33:44:55 | ||
3 | mtu 1000 | ||
4 | net br1 | ||
5 | ip 10.10.30.50 | ||
6 | net br2 | ||
7 | ip 10.10.40.100 | ||
8 | net br3 | ||
9 | defaultgw 10.10.20.2 | ||
10 | |||
diff --git a/test/net_profile.exp b/test/net_profile.exp new file mode 100755 index 000000000..37043c906 --- /dev/null +++ b/test/net_profile.exp | |||
@@ -0,0 +1,73 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | # check eth0 | ||
8 | send -- "firejail --profile=net-profile.profile\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0.0\n";exit} | ||
11 | "eth0" | ||
12 | } | ||
13 | expect { | ||
14 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
15 | "00:11:22:33:44:55" | ||
16 | } | ||
17 | expect { | ||
18 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
19 | "10.10.20" | ||
20 | } | ||
21 | expect { | ||
22 | timeout {puts "TESTING ERROR 0.2\n";exit} | ||
23 | "255.255.255.248" | ||
24 | } | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 0.3\n";exit} | ||
27 | "UP" | ||
28 | } | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 0.4\n";exit} | ||
31 | "Child process initialized" | ||
32 | } | ||
33 | sleep 2 | ||
34 | |||
35 | send -- "ip route show\r" | ||
36 | expect { | ||
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 | |||
41 | send -- "ip route show\r" | ||
42 | expect { | ||
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 | ||
49 | send -- "ip route show\r" | ||
50 | expect { | ||
51 | timeout {puts "TESTING ERROR 3\n";exit} | ||
52 | "default via 10.10.20.2 dev eth0" | ||
53 | } | ||
54 | |||
55 | # check mtu | ||
56 | send -- "ip link show\r" | ||
57 | expect { | ||
58 | timeout {puts "TESTING ERROR 4\n";exit} | ||
59 | "eth0" | ||
60 | } | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 5\n";exit} | ||
63 | "mtu 1000" | ||
64 | } | ||
65 | expect { | ||
66 | timeout {puts "TESTING ERROR 6\n";exit} | ||
67 | "state UP" | ||
68 | } | ||
69 | |||
70 | sleep 1 | ||
71 | |||
72 | puts "\nall done\n" | ||
73 | |||
diff --git a/test/test.sh b/test/test.sh index c6fe4f299..961b48807 100755 --- a/test/test.sh +++ b/test/test.sh | |||
@@ -10,6 +10,9 @@ echo "TESTING: cpu.print (cpu-print.exp)" | |||
10 | echo "TESTING: failing under VirtualBox where there is only one CPU" | 10 | echo "TESTING: failing under VirtualBox where there is only one CPU" |
11 | ./cpu-print.exp | 11 | ./cpu-print.exp |
12 | 12 | ||
13 | echo "TESTING: network profile (net_profile.exp)" | ||
14 | ./net_profile.exp | ||
15 | |||
13 | echo "TESTING: bandwidth (bandwidth.exp)" | 16 | echo "TESTING: bandwidth (bandwidth.exp)" |
14 | ./bandwidth.exp | 17 | ./bandwidth.exp |
15 | 18 | ||