diff options
author | netblue30 <netblue30@yahoo.com> | 2016-05-03 08:41:24 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-05-03 08:41:24 -0400 |
commit | 57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc (patch) | |
tree | 60f90718665a1a812b552f589bc4d85616232df1 /test/network/net_none.exp | |
parent | Merge branch 'master' of https://github.com/netblue30/firejail (diff) | |
download | firejail-57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc.tar.gz firejail-57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc.tar.zst firejail-57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc.zip |
networking features testing
Diffstat (limited to 'test/network/net_none.exp')
-rwxr-xr-x | test/network/net_none.exp | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/test/network/net_none.exp b/test/network/net_none.exp new file mode 100755 index 000000000..54b6cb946 --- /dev/null +++ b/test/network/net_none.exp | |||
@@ -0,0 +1,68 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 10 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | # options | ||
8 | send -- "firejail --net=none\r" | ||
9 | expect { | ||
10 | timeout {puts "TESTING ERROR 0\n";exit} | ||
11 | "eth0" {puts "TESTING ERROR 0.1\n";exit} | ||
12 | "Child process initialized" | ||
13 | } | ||
14 | sleep 1 | ||
15 | |||
16 | # test default gw | ||
17 | send -- "bash\r" | ||
18 | sleep 1 | ||
19 | send -- "netstat -rn; pwd\r" | ||
20 | expect { | ||
21 | timeout {puts "TESTING ERROR 1\n";exit} | ||
22 | "0.0.0.0" {puts "TESTING ERROR 1.1\n";exit} | ||
23 | "home" | ||
24 | } | ||
25 | sleep 1 | ||
26 | |||
27 | # check again devices | ||
28 | send -- "cat /proc/1/net/dev;pwd\r" | ||
29 | expect { | ||
30 | timeout {puts "TESTING ERROR 2\n";exit} | ||
31 | "eth0" {puts "TESTING ERROR 2.1\n";exit} | ||
32 | "home" | ||
33 | } | ||
34 | send -- "exit\r" | ||
35 | sleep 1 | ||
36 | send -- "exit\r" | ||
37 | sleep 1 | ||
38 | |||
39 | # profile | ||
40 | send -- "firejail --profile=net_none.profile\r" | ||
41 | expect { | ||
42 | timeout {puts "TESTING ERROR 3\n";exit} | ||
43 | "eth0" {puts "TESTING ERROR 3.1\n";exit} | ||
44 | "Child process initialized" | ||
45 | } | ||
46 | sleep 1 | ||
47 | |||
48 | # test default gw | ||
49 | send -- "bash\r" | ||
50 | sleep 1 | ||
51 | send -- "netstat -rn; pwd\r" | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 4\n";exit} | ||
54 | "0.0.0.0" {puts "TESTING ERROR 4.1\n";exit} | ||
55 | "home" | ||
56 | } | ||
57 | sleep 1 | ||
58 | |||
59 | # check again devices | ||
60 | send -- "cat /proc/1/net/dev;pwd\r" | ||
61 | expect { | ||
62 | timeout {puts "TESTING ERROR 5\n";exit} | ||
63 | "eth0" {puts "TESTING ERROR 5.1\n";exit} | ||
64 | "home" | ||
65 | } | ||
66 | sleep 1 | ||
67 | |||
68 | puts "\n" | ||