diff options
Diffstat (limited to 'test/net_noip.exp')
-rwxr-xr-x | test/net_noip.exp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/net_noip.exp b/test/net_noip.exp new file mode 100755 index 000000000..3db67885d --- /dev/null +++ b/test/net_noip.exp | |||
@@ -0,0 +1,41 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | # check ip address | ||
8 | send -- "firejail --net=br0 --ip=none\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0\n";exit} | ||
11 | "eth0" {puts "TESTING ERROR 1\n";exit} | ||
12 | "Child process initialized" | ||
13 | } | ||
14 | sleep 1 | ||
15 | send -- "bash\r" | ||
16 | sleep 1 | ||
17 | |||
18 | # no default gateway configured | ||
19 | send -- "netstat -rn;pwd\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 2\n";exit} | ||
22 | "0.0.0.0" {puts "TESTING ERROR 3\n";exit} | ||
23 | "eth0" {puts "TESTING ERROR 4\n";exit} | ||
24 | "home" | ||
25 | } | ||
26 | sleep 1 | ||
27 | |||
28 | # eth0 configured | ||
29 | send -- "/sbin/ifconfig;pwd\r" | ||
30 | expect { | ||
31 | timeout {puts "TESTING ERROR 5\n";exit} | ||
32 | "eth0" | ||
33 | } | ||
34 | expect { | ||
35 | timeout {puts "TESTING ERROR 6\n";exit} | ||
36 | "home" | ||
37 | } | ||
38 | sleep 1 | ||
39 | |||
40 | puts "\n" | ||
41 | |||