diff options
author | netblue30 <netblue30@yahoo.com> | 2016-02-08 12:58:37 -0500 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2016-02-08 12:58:37 -0500 |
commit | 9c0730573aa6f5cf96278704a9a8c14457f1e010 (patch) | |
tree | 0c1c05f54f2eaa146131c16bc877dec200f39931 /test | |
parent | set window title (diff) | |
download | firejail-9c0730573aa6f5cf96278704a9a8c14457f1e010.tar.gz firejail-9c0730573aa6f5cf96278704a9a8c14457f1e010.tar.zst firejail-9c0730573aa6f5cf96278704a9a8c14457f1e010.zip |
fixed whitelist problem
Diffstat (limited to 'test')
-rwxr-xr-x | test/test.sh | 3 | ||||
-rwxr-xr-x | test/whitelist-empty.exp | 50 |
2 files changed, 53 insertions, 0 deletions
diff --git a/test/test.sh b/test/test.sh index 6273c0a1b..ca7152b55 100755 --- a/test/test.sh +++ b/test/test.sh | |||
@@ -15,6 +15,9 @@ echo "TESTING: invalid filename" | |||
15 | echo "TESTING: environment variables" | 15 | echo "TESTING: environment variables" |
16 | ./env.exp | 16 | ./env.exp |
17 | 17 | ||
18 | echo "TESTING: whitelist empty" | ||
19 | ./whitelist-empty.exp | ||
20 | |||
18 | echo "TESTING: ignore command" | 21 | echo "TESTING: ignore command" |
19 | ./ignore.exp | 22 | ./ignore.exp |
20 | 23 | ||
diff --git a/test/whitelist-empty.exp b/test/whitelist-empty.exp new file mode 100755 index 000000000..226b019db --- /dev/null +++ b/test/whitelist-empty.exp | |||
@@ -0,0 +1,50 @@ | |||
1 | #!/usr/bin/expect -f | ||
2 | |||
3 | set timeout 30 | ||
4 | spawn $env(SHELL) | ||
5 | match_max 100000 | ||
6 | |||
7 | send -- "firejail --whitelist=~/blablabla --whitelist=/tmp/blablabla --whitelist=/media/blablabla --whitelist=/var/blablabla --whitelist=/dev/blablabla --whitelist=/opt/blablabla\r" | ||
8 | expect { | ||
9 | timeout {puts "TESTING ERROR 0\n";exit} | ||
10 | "Child process initialized" | ||
11 | } | ||
12 | sleep 1 | ||
13 | |||
14 | send -- "ls -l ~/ | wc -l\r" | ||
15 | expect { | ||
16 | timeout {puts "TESTING ERROR 1\n";exit} | ||
17 | "0" | ||
18 | } | ||
19 | |||
20 | send -- "ls -l /tmp | wc -l\r" | ||
21 | expect { | ||
22 | timeout {puts "TESTING ERROR 2\n";exit} | ||
23 | "0" | ||
24 | } | ||
25 | |||
26 | send -- "ls -l /media | wc -l\r" | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 3\n";exit} | ||
29 | "0" | ||
30 | } | ||
31 | |||
32 | send -- "ls -l /var | wc -l\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 4\n";exit} | ||
35 | "0" | ||
36 | } | ||
37 | |||
38 | send -- "ls -l /dev | wc -l\r" | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 5\n";exit} | ||
41 | "0" | ||
42 | } | ||
43 | send -- "ls -l /opt | wc -l\r" | ||
44 | expect { | ||
45 | timeout {puts "TESTING ERROR 6\n";exit} | ||
46 | "0" | ||
47 | } | ||
48 | |||
49 | |||
50 | puts "\nall done\n" | ||