From c3bd40d2404319cca625ecc521a4514d27e8f76a Mon Sep 17 00:00:00 2001 From: netblue30 Date: Tue, 17 Nov 2015 10:41:52 -0500 Subject: allow mixing of whitelist and private --- test/private-whitelist.exp | 36 ++++++++++++++++++++++++++++++++++++ test/test.sh | 3 +++ 2 files changed, 39 insertions(+) create mode 100755 test/private-whitelist.exp (limited to 'test') diff --git a/test/private-whitelist.exp b/test/private-whitelist.exp new file mode 100755 index 000000000..b78eb3b61 --- /dev/null +++ b/test/private-whitelist.exp @@ -0,0 +1,36 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --private --whitelist=/tmp/.X11-unix\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -al /tmp\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + ".X11-unix" +} +sleep 1 + +send -- "ls -a /tmp | wc\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "3" +} +sleep 1 + +send -- "ls -a ~ | wc\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "4" +} + +sleep 1 +puts "\nall done\n" + diff --git a/test/test.sh b/test/test.sh index 61e5cce35..fdb1f8ed7 100755 --- a/test/test.sh +++ b/test/test.sh @@ -30,6 +30,9 @@ echo "TESTING: private-etc" echo "TESTING: private-bin" ./private-bin.exp +echo "TESTING: private whitelist" +./private-whitelist.exp + sleep 1 rm -fr dir\ with\ space mkdir dir\ with\ space -- cgit v1.2.3-54-g00ecf