diff options
author | netblue30 <netblue30@yahoo.com> | 2015-08-22 07:21:50 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-08-22 07:21:50 -0400 |
commit | 7f84ed7a38a5f83deaab94522978cbf5b5c89465 (patch) | |
tree | d17524b1492b7c15f566137336eddf691e6676b3 /test | |
parent | added --enable-fatal-warnings (diff) | |
download | firejail-7f84ed7a38a5f83deaab94522978cbf5b5c89465.tar.gz firejail-7f84ed7a38a5f83deaab94522978cbf5b5c89465.tar.zst firejail-7f84ed7a38a5f83deaab94522978cbf5b5c89465.zip |
support net none in profile files
Diffstat (limited to 'test')
-rwxr-xr-x | test/net_none.exp | 32 | ||||
-rw-r--r-- | test/net_none.profile | 1 |
2 files changed, 33 insertions, 0 deletions
diff --git a/test/net_none.exp b/test/net_none.exp index dfa14a211..54b6cb946 100755 --- a/test/net_none.exp +++ b/test/net_none.exp | |||
@@ -4,6 +4,7 @@ set timeout 10 | |||
4 | spawn $env(SHELL) | 4 | spawn $env(SHELL) |
5 | match_max 100000 | 5 | match_max 100000 |
6 | 6 | ||
7 | # options | ||
7 | send -- "firejail --net=none\r" | 8 | send -- "firejail --net=none\r" |
8 | expect { | 9 | expect { |
9 | timeout {puts "TESTING ERROR 0\n";exit} | 10 | timeout {puts "TESTING ERROR 0\n";exit} |
@@ -30,7 +31,38 @@ expect { | |||
30 | "eth0" {puts "TESTING ERROR 2.1\n";exit} | 31 | "eth0" {puts "TESTING ERROR 2.1\n";exit} |
31 | "home" | 32 | "home" |
32 | } | 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 | } | ||
33 | sleep 1 | 46 | sleep 1 |
34 | 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 | ||
35 | 67 | ||
36 | puts "\n" | 68 | puts "\n" |
diff --git a/test/net_none.profile b/test/net_none.profile new file mode 100644 index 000000000..079c08ea8 --- /dev/null +++ b/test/net_none.profile | |||
@@ -0,0 +1 @@ | |||
net none | |||