From 7f84ed7a38a5f83deaab94522978cbf5b5c89465 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sat, 22 Aug 2015 07:21:50 -0400 Subject: support net none in profile files --- test/net_none.exp | 32 ++++++++++++++++++++++++++++++++ test/net_none.profile | 1 + 2 files changed, 33 insertions(+) create mode 100644 test/net_none.profile (limited to 'test') 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 spawn $env(SHELL) match_max 100000 +# options send -- "firejail --net=none\r" expect { timeout {puts "TESTING ERROR 0\n";exit} @@ -30,7 +31,38 @@ expect { "eth0" {puts "TESTING ERROR 2.1\n";exit} "home" } +send -- "exit\r" +sleep 1 +send -- "exit\r" +sleep 1 + +# profile +send -- "firejail --profile=net_none.profile\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "eth0" {puts "TESTING ERROR 3.1\n";exit} + "Child process initialized" +} sleep 1 +# test default gw +send -- "bash\r" +sleep 1 +send -- "netstat -rn; pwd\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "0.0.0.0" {puts "TESTING ERROR 4.1\n";exit} + "home" +} +sleep 1 + +# check again devices +send -- "cat /proc/1/net/dev;pwd\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "eth0" {puts "TESTING ERROR 5.1\n";exit} + "home" +} +sleep 1 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 -- cgit v1.2.3-70-g09d2