aboutsummaryrefslogtreecommitdiffstats
path: root/test/network/net_none.exp
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-05-03 08:41:24 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-05-03 08:41:24 -0400
commit57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc (patch)
tree60f90718665a1a812b552f589bc4d85616232df1 /test/network/net_none.exp
parentMerge branch 'master' of https://github.com/netblue30/firejail (diff)
downloadfirejail-57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc.tar.gz
firejail-57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc.tar.zst
firejail-57bea6c8c4d1bd666ce57057b1cbb681b3cc4afc.zip
networking features testing
Diffstat (limited to 'test/network/net_none.exp')
-rwxr-xr-xtest/network/net_none.exp68
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
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7# options
8send -- "firejail --net=none\r"
9expect {
10 timeout {puts "TESTING ERROR 0\n";exit}
11 "eth0" {puts "TESTING ERROR 0.1\n";exit}
12 "Child process initialized"
13}
14sleep 1
15
16# test default gw
17send -- "bash\r"
18sleep 1
19send -- "netstat -rn; pwd\r"
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "0.0.0.0" {puts "TESTING ERROR 1.1\n";exit}
23 "home"
24}
25sleep 1
26
27# check again devices
28send -- "cat /proc/1/net/dev;pwd\r"
29expect {
30 timeout {puts "TESTING ERROR 2\n";exit}
31 "eth0" {puts "TESTING ERROR 2.1\n";exit}
32 "home"
33}
34send -- "exit\r"
35sleep 1
36send -- "exit\r"
37sleep 1
38
39# profile
40send -- "firejail --profile=net_none.profile\r"
41expect {
42 timeout {puts "TESTING ERROR 3\n";exit}
43 "eth0" {puts "TESTING ERROR 3.1\n";exit}
44 "Child process initialized"
45}
46sleep 1
47
48# test default gw
49send -- "bash\r"
50sleep 1
51send -- "netstat -rn; pwd\r"
52expect {
53 timeout {puts "TESTING ERROR 4\n";exit}
54 "0.0.0.0" {puts "TESTING ERROR 4.1\n";exit}
55 "home"
56}
57sleep 1
58
59# check again devices
60send -- "cat /proc/1/net/dev;pwd\r"
61expect {
62 timeout {puts "TESTING ERROR 5\n";exit}
63 "eth0" {puts "TESTING ERROR 5.1\n";exit}
64 "home"
65}
66sleep 1
67
68puts "\n"