diff options
Diffstat (limited to 'test/fs/option_blacklist_file.exp')
-rwxr-xr-x | test/fs/option_blacklist_file.exp | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/test/fs/option_blacklist_file.exp b/test/fs/option_blacklist_file.exp index b0bcc741b..247e69121 100755 --- a/test/fs/option_blacklist_file.exp +++ b/test/fs/option_blacklist_file.exp | |||
@@ -7,7 +7,12 @@ set timeout 10 | |||
7 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
8 | match_max 100000 | 8 | match_max 100000 |
9 | 9 | ||
10 | send -- "firejail --blacklist=/etc/passwd\r" | 10 | send -- "mkdir ~/_firejail_test_dir\r" |
11 | after 100 | ||
12 | send -- "touch ~/_firejail_test_dir/a\r" | ||
13 | after 100 | ||
14 | |||
15 | send -- "firejail --blacklist=/etc/passwd --blacklist=~/_firejail_test_dir\r" | ||
11 | expect { | 16 | expect { |
12 | timeout {puts "TESTING ERROR 0\n";exit} | 17 | timeout {puts "TESTING ERROR 0\n";exit} |
13 | "Child process initialized" | 18 | "Child process initialized" |
@@ -17,6 +22,16 @@ sleep 1 | |||
17 | send -- "cat /etc/passwd;echo done\r" | 22 | send -- "cat /etc/passwd;echo done\r" |
18 | expect { | 23 | expect { |
19 | timeout {puts "TESTING ERROR 1\n";exit} | 24 | timeout {puts "TESTING ERROR 1\n";exit} |
25 | "No such file or directory" | ||
26 | } | ||
27 | expect { | ||
28 | timeout {puts "TESTING ERROR 2\n";exit} | ||
29 | "done" | ||
30 | } | ||
31 | after 100 | ||
32 | send -- "cat ~/_firejail_test_dir/a;echo done\r" | ||
33 | expect { | ||
34 | timeout {puts "TESTING ERROR 1\n";exit} | ||
20 | "Permission denied" | 35 | "Permission denied" |
21 | } | 36 | } |
22 | expect { | 37 | expect { |
@@ -25,4 +40,10 @@ expect { | |||
25 | } | 40 | } |
26 | after 100 | 41 | after 100 |
27 | 42 | ||
28 | puts "\n" | 43 | send -- "exit\r" |
44 | sleep 1 | ||
45 | |||
46 | send -- "rm -fr ~/_firejail_test_dir\r" | ||
47 | after 100 | ||
48 | |||
49 | puts "\nall done\n" | ||