aboutsummaryrefslogtreecommitdiffstats
path: root/test/root
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-11-29 10:04:43 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-11-29 10:04:43 -0500
commitd3b6581db7fcd0fb0897ada9910140f0e43f4ed1 (patch)
tree1c4409a84665834736370f89dcf915a12f173ef5 /test/root
parentMerge pull request #945 from Fred-Barclay/cryptocat (diff)
downloadfirejail-d3b6581db7fcd0fb0897ada9910140f0e43f4ed1.tar.gz
firejail-d3b6581db7fcd0fb0897ada9910140f0e43f4ed1.tar.zst
firejail-d3b6581db7fcd0fb0897ada9910140f0e43f4ed1.zip
testing and cleanup
Diffstat (limited to 'test/root')
-rwxr-xr-xtest/root/root.sh3
-rwxr-xr-xtest/root/whitelist-mnt.exp86
2 files changed, 89 insertions, 0 deletions
diff --git a/test/root/root.sh b/test/root/root.sh
index 494bd4fe7..01c372f68 100755
--- a/test/root/root.sh
+++ b/test/root/root.sh
@@ -53,6 +53,9 @@ fi
53echo "TESTING: fs private (test/root/private.exp)" 53echo "TESTING: fs private (test/root/private.exp)"
54./private.exp 54./private.exp
55 55
56echo "TESTING: fs whitelist mnt, opt, media(test/root/whitelist-mnt.exp)"
57./whitelist-mnt.exp
58
56#******************************** 59#********************************
57# seccomp 60# seccomp
58#******************************** 61#********************************
diff --git a/test/root/whitelist-mnt.exp b/test/root/whitelist-mnt.exp
new file mode 100755
index 000000000..58ae4fffc
--- /dev/null
+++ b/test/root/whitelist-mnt.exp
@@ -0,0 +1,86 @@
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 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "touch /mnt/firejail-test-file\r"
11after 100
12send -- "firejail --whitelist=/mnt/firejail-test-file --debug\r"
13expect {
14 timeout {puts "TESTING ERROR 0\n";exit}
15 "Child process initialized"
16}
17sleep 1
18
19send -- "find /mnt | wc -l\r"
20expect {
21 timeout {puts "TESTING ERROR 1\n";exit}
22 "2"
23}
24after 100
25send -- "exit\r"
26sleep 1
27
28
29send -- "touch /opt/firejail-test-file\r"
30after 100
31send -- "firejail --whitelist=/opt/firejail-test-file --debug\r"
32expect {
33 timeout {puts "TESTING ERROR 0\n";exit}
34 "Child process initialized"
35}
36sleep 1
37
38send -- "find /opt | wc -l\r"
39expect {
40 timeout {puts "TESTING ERROR 1\n";exit}
41 "2"
42}
43after 100
44send -- "exit\r"
45sleep 1
46
47send -- "touch /media/firejail-test-file\r"
48after 100
49send -- "firejail --whitelist=/media/firejail-test-file --debug\r"
50expect {
51 timeout {puts "TESTING ERROR 0\n";exit}
52 "Child process initialized"
53}
54sleep 1
55
56send -- "find /media | wc -l\r"
57expect {
58 timeout {puts "TESTING ERROR 1\n";exit}
59 "2"
60}
61after 100
62send -- "exit\r"
63sleep 1
64
65
66send -- "firejail --whitelist=/var/run --whitelist=/var/lock --debug\r"
67expect {
68 timeout {puts "TESTING ERROR 0\n";exit}
69 "Child process initialized"
70}
71sleep 1
72
73send -- "find /var | wc -l\r"
74expect {
75 timeout {puts "TESTING ERROR 1\n";exit}
76 ""
77}
78after 100
79send -- "exit\r"
80sleep 1
81
82
83
84after 100
85puts "\nall done\n"
86