diff options
Diffstat (limited to 'test/fs/private-whitelist.exp')
-rwxr-xr-x | test/fs/private-whitelist.exp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/fs/private-whitelist.exp b/test/fs/private-whitelist.exp new file mode 100755 index 000000000..4dadeacb1 --- /dev/null +++ b/test/fs/private-whitelist.exp | |||
@@ -0,0 +1,41 @@ | |||
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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "firejail --private --whitelist=/tmp/.X11-unix\r" | ||
11 | expect { | ||
12 | timeout {puts "TESTING ERROR 1\n";exit} | ||
13 | "Child process initialized" | ||
14 | } | ||
15 | after 100 | ||
16 | |||
17 | send -- "ls -al /tmp\r" | ||
18 | expect { | ||
19 | timeout {puts "TESTING ERROR 2\n";exit} | ||
20 | ".X11-unix" | ||
21 | } | ||
22 | after 100 | ||
23 | |||
24 | send -- "ls -a /tmp | wc -l\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 3\n";exit} | ||
27 | "3" | ||
28 | } | ||
29 | after 100 | ||
30 | |||
31 | send -- "ls -a ~ | wc -l\r" | ||
32 | expect { | ||
33 | timeout {puts "TESTING ERROR 4\n";exit} | ||
34 | "3" {puts "3\n"} | ||
35 | "4" {puts "4\n"} | ||
36 | "5" {puts "5\n"} | ||
37 | } | ||
38 | |||
39 | sleep 1 | ||
40 | puts "\nall done\n" | ||
41 | |||