aboutsummaryrefslogtreecommitdiffstats
path: root/test/root/whitelist-mnt.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/root/whitelist-mnt.exp')
-rwxr-xr-xtest/root/whitelist-mnt.exp86
1 files changed, 86 insertions, 0 deletions
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