diff options
Diffstat (limited to 'test/network')
-rwxr-xr-x | test/network/dns-print.exp | 31 | ||||
-rwxr-xr-x | test/network/net_macvlan.exp | 93 | ||||
-rwxr-xr-x | test/network/net_macvlan2.exp | 43 | ||||
-rwxr-xr-x | test/network/network.sh | 9 |
4 files changed, 83 insertions, 93 deletions
diff --git a/test/network/dns-print.exp b/test/network/dns-print.exp new file mode 100755 index 000000000..9cdc14a6d --- /dev/null +++ b/test/network/dns-print.exp | |||
@@ -0,0 +1,31 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --name=test-dns --net=eth0 --dns=1.2.3.4 --dns=2.3.4.5 --dns=3.4.5.6\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 1\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | sleep 1 | ||
13 | |||
14 | spawn $env(SHELL) | ||
15 | send -- "firejail --dns.print=test-dns\r" | ||
16 | expect { | ||
17 | timeout {puts "TESTING ERROR 2\n";exit} | ||
18 | "nameserver 1.2.3.4" | ||
19 | } | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 2\n";exit} | ||
22 | "nameserver 2.3.4.5" | ||
23 | } | ||
24 | expect { | ||
25 | timeout {puts "TESTING ERROR 2\n";exit} | ||
26 | "nameserver 3.4.5.6" | ||
27 | } | ||
28 | |||
29 | after 100 | ||
30 | |||
31 | puts "\nall done\n" | ||
diff --git a/test/network/net_macvlan.exp b/test/network/net_macvlan.exp deleted file mode 100755 index f457ea98f..000000000 --- a/test/network/net_macvlan.exp +++ /dev/null | |||
@@ -1,93 +0,0 @@ | |||
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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | # check the existing address | ||
11 | spawn $env(SHELL) | ||
12 | send -- "firejail --net=eth0 --ip=192.168.1.60\r" | ||
13 | expect { | ||
14 | timeout {puts "TESTING ERROR 1.1\n";puts "Please open a sandbox on 192.168.1.60\n";exit} | ||
15 | "the address 192.168.1.60 is already in use" | ||
16 | } | ||
17 | |||
18 | |||
19 | |||
20 | # grab 30 ip addresses | ||
21 | set MAXi 229 | ||
22 | set i 200 | ||
23 | while { $i <= $MAXi } { | ||
24 | spawn $env(SHELL) | ||
25 | send -- "firejail --net=eth0 --ip=192.168.1.$i\r" | ||
26 | expect { | ||
27 | timeout {puts "TESTING ERROR 0\n";exit} | ||
28 | "Child process initialized" | ||
29 | } | ||
30 | incr i | ||
31 | after 100 | ||
32 | } | ||
33 | |||
34 | |||
35 | # check an existing address | ||
36 | spawn $env(SHELL) | ||
37 | send -- "firejail --net=eth0 --ip=192.168.1.200\r" | ||
38 | expect { | ||
39 | timeout {puts "TESTING ERROR 1\n";exit} | ||
40 | "the address 192.168.1.200 is already in use" | ||
41 | } | ||
42 | |||
43 | |||
44 | set MAXi 254 | ||
45 | set i 2 | ||
46 | while { $i <= $MAXi } { | ||
47 | spawn $env(SHELL) | ||
48 | send -- "firejail --net=eth0\r" | ||
49 | expect { | ||
50 | timeout {puts "TESTING ERROR 2.1\n";exit} | ||
51 | "192.168.1.60" {puts "TESTING ERROR 2.2\n";exit} | ||
52 | "192.168.1.200" {puts "TESTING ERROR 3\n";exit} | ||
53 | "192.168.1.201" {puts "TESTING ERROR 3\n";exit} | ||
54 | "192.168.1.202" {puts "TESTING ERROR 3\n";exit} | ||
55 | "192.168.1.203" {puts "TESTING ERROR 3\n";exit} | ||
56 | "192.168.1.204" {puts "TESTING ERROR 3\n";exit} | ||
57 | "192.168.1.205" {puts "TESTING ERROR 3\n";exit} | ||
58 | "192.168.1.206" {puts "TESTING ERROR 3\n";exit} | ||
59 | "192.168.1.207" {puts "TESTING ERROR 3\n";exit} | ||
60 | "192.168.1.208" {puts "TESTING ERROR 3\n";exit} | ||
61 | "192.168.1.209" {puts "TESTING ERROR 3\n";exit} | ||
62 | "192.168.1.210" {puts "TESTING ERROR 3\n";exit} | ||
63 | "192.168.1.211" {puts "TESTING ERROR 3\n";exit} | ||
64 | "192.168.1.212" {puts "TESTING ERROR 3\n";exit} | ||
65 | "192.168.1.213" {puts "TESTING ERROR 3\n";exit} | ||
66 | "192.168.1.214" {puts "TESTING ERROR 3\n";exit} | ||
67 | "192.168.1.215" {puts "TESTING ERROR 3\n";exit} | ||
68 | "192.168.1.216" {puts "TESTING ERROR 3\n";exit} | ||
69 | "192.168.1.217" {puts "TESTING ERROR 3\n";exit} | ||
70 | "192.168.1.218" {puts "TESTING ERROR 3\n";exit} | ||
71 | "192.168.1.219" {puts "TESTING ERROR 3\n";exit} | ||
72 | "192.168.1.220" {puts "TESTING ERROR 3\n";exit} | ||
73 | "192.168.1.221" {puts "TESTING ERROR 3\n";exit} | ||
74 | "192.168.1.222" {puts "TESTING ERROR 3\n";exit} | ||
75 | "192.168.1.223" {puts "TESTING ERROR 3\n";exit} | ||
76 | "192.168.1.224" {puts "TESTING ERROR 3\n";exit} | ||
77 | "192.168.1.225" {puts "TESTING ERROR 3\n";exit} | ||
78 | "192.168.1.226" {puts "TESTING ERROR 3\n";exit} | ||
79 | "192.168.1.227" {puts "TESTING ERROR 3\n";exit} | ||
80 | "192.168.1.228" {puts "TESTING ERROR 3\n";exit} | ||
81 | "192.168.1.229" {puts "TESTING ERROR 3\n";exit} | ||
82 | "Child process initialized" | ||
83 | } | ||
84 | puts "************ $i ******************\n" | ||
85 | incr i | ||
86 | after 100 | ||
87 | # sleep 1 | ||
88 | } | ||
89 | send -- "exit\r" | ||
90 | after 100 | ||
91 | |||
92 | puts "\n" | ||
93 | |||
diff --git a/test/network/net_macvlan2.exp b/test/network/net_macvlan2.exp new file mode 100755 index 000000000..7f21fc083 --- /dev/null +++ b/test/network/net_macvlan2.exp | |||
@@ -0,0 +1,43 @@ | |||
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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --net=eth0 --net=eth0 --net=eth0 --net=eth0\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 0.1\n";exit} | ||
13 | "eth0-" | ||
14 | } | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 0.2\n";exit} | ||
17 | "eth1-" | ||
18 | } | ||
19 | expect { | ||
20 | timeout {puts "TESTING ERROR 0.3\n";exit} | ||
21 | "eth2-" | ||
22 | } | ||
23 | expect { | ||
24 | timeout {puts "TESTING ERROR 0.4\n";exit} | ||
25 | "eth3-" | ||
26 | } | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 0.5\n";exit} | ||
29 | "Default gateway 192.168.1.1" | ||
30 | } | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 0.6\n";exit} | ||
33 | "Child process initialized" | ||
34 | } | ||
35 | after 100 | ||
36 | send -- "exit\r" | ||
37 | sleep 1 | ||
38 | |||
39 | |||
40 | after 100 | ||
41 | |||
42 | puts "\nall done\n" | ||
43 | |||
diff --git a/test/network/network.sh b/test/network/network.sh index bea5dfb26..94df9935e 100755 --- a/test/network/network.sh +++ b/test/network/network.sh | |||
@@ -11,6 +11,9 @@ sudo ./configure | |||
11 | echo "TESTING: firemon interface (firemon-interfaces.exp)" | 11 | echo "TESTING: firemon interface (firemon-interfaces.exp)" |
12 | sudo ./firemon-interfaces.exp | 12 | sudo ./firemon-interfaces.exp |
13 | 13 | ||
14 | echo "TESTING: print dns (dns-print.exp)" | ||
15 | ./dns-print.exp | ||
16 | |||
14 | echo "TESTING: firemon arp (firemon-arp.exp)" | 17 | echo "TESTING: firemon arp (firemon-arp.exp)" |
15 | ./firemon-arp.exp | 18 | ./firemon-arp.exp |
16 | 19 | ||
@@ -69,6 +72,9 @@ echo "TESTING: network default gateway test 3 (net_defaultgw3.exp)" | |||
69 | echo "TESTING: scan (net_scan.exp)" | 72 | echo "TESTING: scan (net_scan.exp)" |
70 | ./net_scan.exp | 73 | ./net_scan.exp |
71 | 74 | ||
75 | echo "TESTING: mtu (mtu.exp)" | ||
76 | ./mtu.exp | ||
77 | |||
72 | echo "TESTING: interface (interface.exp)" | 78 | echo "TESTING: interface (interface.exp)" |
73 | ./interface.exp | 79 | ./interface.exp |
74 | 80 | ||
@@ -84,6 +90,9 @@ echo "TESTING: iprange (iprange.exp)" | |||
84 | echo "TESTING: veth-name (veth-name.exp)" | 90 | echo "TESTING: veth-name (veth-name.exp)" |
85 | ./veth-name.exp | 91 | ./veth-name.exp |
86 | 92 | ||
93 | echo "TESTING: macvlan2 (net_macvlan2.exp)" | ||
94 | ./net_macvlan2.exp | ||
95 | |||
87 | echo "TESTING: 4 bridges ARP (4bridges_arp.exp)" | 96 | echo "TESTING: 4 bridges ARP (4bridges_arp.exp)" |
88 | ./4bridges_arp.exp | 97 | ./4bridges_arp.exp |
89 | 98 | ||