aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-08-22 07:21:50 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2015-08-22 07:21:50 -0400
commit7f84ed7a38a5f83deaab94522978cbf5b5c89465 (patch)
treed17524b1492b7c15f566137336eddf691e6676b3 /test
parentadded --enable-fatal-warnings (diff)
downloadfirejail-7f84ed7a38a5f83deaab94522978cbf5b5c89465.tar.gz
firejail-7f84ed7a38a5f83deaab94522978cbf5b5c89465.tar.zst
firejail-7f84ed7a38a5f83deaab94522978cbf5b5c89465.zip
support net none in profile files
Diffstat (limited to 'test')
-rwxr-xr-xtest/net_none.exp32
-rw-r--r--test/net_none.profile1
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
4spawn $env(SHELL) 4spawn $env(SHELL)
5match_max 100000 5match_max 100000
6 6
7# options
7send -- "firejail --net=none\r" 8send -- "firejail --net=none\r"
8expect { 9expect {
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}
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}
33sleep 1 46sleep 1
34 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
35 67
36puts "\n" 68puts "\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