aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-05-07 10:05:29 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2016-05-07 10:05:29 -0400
commit571e8a53d6f083de8c6c90cdc9e6c48c31bb2702 (patch)
tree53f63b3f9ec76c2d958246fe8e184b71615604d4 /test
parentMerge pull request #502 from Fred-Barclay/xapps (diff)
downloadfirejail-571e8a53d6f083de8c6c90cdc9e6c48c31bb2702.tar.gz
firejail-571e8a53d6f083de8c6c90cdc9e6c48c31bb2702.tar.zst
firejail-571e8a53d6f083de8c6c90cdc9e6c48c31bb2702.zip
fix private-etc empty list
Diffstat (limited to 'test')
-rwxr-xr-xtest/fs/fs.sh3
-rwxr-xr-xtest/fs/private-etc-empty.exp38
-rw-r--r--test/fs/private-etc-empty.profile1
3 files changed, 42 insertions, 0 deletions
diff --git a/test/fs/fs.sh b/test/fs/fs.sh
index 0fcffcb8e..b49aadf02 100755
--- a/test/fs/fs.sh
+++ b/test/fs/fs.sh
@@ -24,6 +24,9 @@ echo "TESTING: private (test/fs/private.exp)"
24echo "TESTING: private-etc (test/fs/private-etc.exp)" 24echo "TESTING: private-etc (test/fs/private-etc.exp)"
25./private-etc.exp 25./private-etc.exp
26 26
27echo "TESTING: empty private-etc (test/fs/private-etc-empty.exp)"
28./private-etc-empty.exp
29
27echo "TESTING: private-bin (test/fs/private-bin.exp)" 30echo "TESTING: private-bin (test/fs/private-bin.exp)"
28./private-bin.exp 31./private-bin.exp
29 32
diff --git a/test/fs/private-etc-empty.exp b/test/fs/private-etc-empty.exp
new file mode 100755
index 000000000..13e917a5c
--- /dev/null
+++ b/test/fs/private-etc-empty.exp
@@ -0,0 +1,38 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 Firejail Authors
4# License GPL v2
5
6set timeout 30
7spawn $env(SHELL)
8match_max 100000
9
10send -- "firejail --private-etc=blablabla\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "Child process initialized"
14}
15sleep 1
16
17send -- "ls -l /etc | wc -l\r"
18expect {
19 timeout {puts "TESTING ERROR 1\n";exit}
20 "0"
21}
22send -- "exit\r"
23sleep 1
24
25send -- "firejail --profile=private-etc-empty.profile\r"
26expect {
27 timeout {puts "TESTING ERROR 0\n";exit}
28 "Child process initialized"
29}
30sleep 1
31
32send -- "ls -l /etc | wc -l\r"
33expect {
34 timeout {puts "TESTING ERROR 1\n";exit}
35 "0"
36}
37
38puts "\nall done\n"
diff --git a/test/fs/private-etc-empty.profile b/test/fs/private-etc-empty.profile
new file mode 100644
index 000000000..38aa8cd68
--- /dev/null
+++ b/test/fs/private-etc-empty.profile
@@ -0,0 +1 @@
private-etc blablabla