aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-11-17 10:41:52 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2015-11-17 10:41:52 -0500
commitc3bd40d2404319cca625ecc521a4514d27e8f76a (patch)
treee26c188478bd45e28c44f58d33e8f06243410c88 /test
parenthandle ~/.config/user-dirs.dirs (diff)
downloadfirejail-c3bd40d2404319cca625ecc521a4514d27e8f76a.tar.gz
firejail-c3bd40d2404319cca625ecc521a4514d27e8f76a.tar.zst
firejail-c3bd40d2404319cca625ecc521a4514d27e8f76a.zip
allow mixing of whitelist and private
Diffstat (limited to 'test')
-rwxr-xr-xtest/private-whitelist.exp36
-rwxr-xr-xtest/test.sh3
2 files changed, 39 insertions, 0 deletions
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 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "firejail --private --whitelist=/tmp/.X11-unix\r"
8expect {
9 timeout {puts "TESTING ERROR 1\n";exit}
10 "Child process initialized"
11}
12sleep 1
13
14send -- "ls -al /tmp\r"
15expect {
16 timeout {puts "TESTING ERROR 2\n";exit}
17 ".X11-unix"
18}
19sleep 1
20
21send -- "ls -a /tmp | wc\r"
22expect {
23 timeout {puts "TESTING ERROR 3\n";exit}
24 "3"
25}
26sleep 1
27
28send -- "ls -a ~ | wc\r"
29expect {
30 timeout {puts "TESTING ERROR 4\n";exit}
31 "4"
32}
33
34sleep 1
35puts "\nall done\n"
36
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"
30echo "TESTING: private-bin" 30echo "TESTING: private-bin"
31./private-bin.exp 31./private-bin.exp
32 32
33echo "TESTING: private whitelist"
34./private-whitelist.exp
35
33sleep 1 36sleep 1
34rm -fr dir\ with\ space 37rm -fr dir\ with\ space
35mkdir dir\ with\ space 38mkdir dir\ with\ space