diff options
author | netblue30 <netblue30@yahoo.com> | 2017-03-29 12:09:26 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2017-03-29 12:09:26 -0400 |
commit | b2b603eac941d2cdea97d7886dc7181c179a8160 (patch) | |
tree | afb0c44459b96f331e07772959bd7e983a082a05 /test/stress/net_macvlan.exp | |
parent | merges (diff) | |
download | firejail-b2b603eac941d2cdea97d7886dc7181c179a8160.tar.gz firejail-b2b603eac941d2cdea97d7886dc7181c179a8160.tar.zst firejail-b2b603eac941d2cdea97d7886dc7181c179a8160.zip |
testing
Diffstat (limited to 'test/stress/net_macvlan.exp')
-rwxr-xr-x | test/stress/net_macvlan.exp | 81 |
1 files changed, 20 insertions, 61 deletions
diff --git a/test/stress/net_macvlan.exp b/test/stress/net_macvlan.exp index 187b5c39f..e0e494ef8 100755 --- a/test/stress/net_macvlan.exp +++ b/test/stress/net_macvlan.exp | |||
@@ -7,19 +7,9 @@ set timeout 10 | |||
7 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
8 | match_max 100000 | 8 | match_max 100000 |
9 | 9 | ||
10 | # check the existing address | 10 | # grab 10 ip addresses |
11 | spawn $env(SHELL) | 11 | set MAXi 210 |
12 | send -- "firejail --net=eth0 --ip=192.168.1.60\r" | 12 | set i 201 |
13 | expect { | ||
14 | timeout {puts "TESTING ERROR 1.1\n";puts "Please open a sandbox on 192.168.1.60\n";exit} | ||
15 | "192.168.1.60 is interface eth0 address" | ||
16 | } | ||
17 | |||
18 | |||
19 | |||
20 | # grab 30 ip addresses | ||
21 | set MAXi 229 | ||
22 | set i 200 | ||
23 | while { $i <= $MAXi } { | 13 | while { $i <= $MAXi } { |
24 | spawn $env(SHELL) | 14 | spawn $env(SHELL) |
25 | send -- "firejail --net=eth0 --ip=192.168.1.$i\r" | 15 | send -- "firejail --net=eth0 --ip=192.168.1.$i\r" |
@@ -32,62 +22,31 @@ while { $i <= $MAXi } { | |||
32 | } | 22 | } |
33 | 23 | ||
34 | 24 | ||
35 | # check an existing address | 25 | # grab 10 more |
36 | spawn $env(SHELL) | 26 | set MAXi 210 |
37 | send -- "firejail --net=eth0 --ip=192.168.1.200\r" | 27 | set i 201 |
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 } { | 28 | while { $i <= $MAXi } { |
47 | spawn $env(SHELL) | 29 | spawn $env(SHELL) |
48 | send -- "firejail --net=eth0\r" | 30 | send -- "firejail --net=eth0 --iprange=192.168.1.201,192.168.1.220\r" |
49 | expect { | 31 | expect { |
50 | timeout {puts "TESTING ERROR 2.1\n";exit} | 32 | timeout {puts "TESTING ERROR 2\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" | 33 | "Child process initialized" |
83 | } | 34 | } |
84 | puts "************ $i ******************\n" | 35 | puts "************ $i ******************\n" |
85 | incr i | 36 | incr i |
86 | after 100 | 37 | after 100 |
87 | # sleep 1 | ||
88 | } | 38 | } |
89 | send -- "exit\r" | ||
90 | after 100 | ||
91 | 39 | ||
92 | puts "\n" | 40 | # the next one should fail, all 20 addresses are in use |
41 | spawn $env(SHELL) | ||
42 | send -- "firejail --debug --net=eth0 --iprange=192.168.1.201,192.168.1.220\r" | ||
43 | expect { | ||
44 | timeout {puts "TESTING ERROR 3\n";exit} | ||
45 | "cannot assign an IP address" | ||
46 | } | ||
47 | |||
48 | |||
49 | |||
50 | after 100 | ||
51 | puts "\nall done\n" | ||
93 | 52 | ||