From b4424d947838cc41fc82f1ba9a7c06b8a49f9bae Mon Sep 17 00:00:00 2001 From: startx2017 Date: Thu, 29 Jul 2021 07:47:16 -0400 Subject: rework make test-fs --- test/fs/option_blacklist_file.exp | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'test/fs/option_blacklist_file.exp') 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 spawn $env(SHELL) match_max 100000 -send -- "firejail --blacklist=/etc/passwd\r" +send -- "mkdir ~/_firejail_test_dir\r" +after 100 +send -- "touch ~/_firejail_test_dir/a\r" +after 100 + +send -- "firejail --blacklist=/etc/passwd --blacklist=~/_firejail_test_dir\r" expect { timeout {puts "TESTING ERROR 0\n";exit} "Child process initialized" @@ -15,6 +20,16 @@ expect { sleep 1 send -- "cat /etc/passwd;echo done\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "No such file or directory" +} +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "done" +} +after 100 +send -- "cat ~/_firejail_test_dir/a;echo done\r" expect { timeout {puts "TESTING ERROR 1\n";exit} "Permission denied" @@ -25,4 +40,10 @@ expect { } after 100 -puts "\n" +send -- "exit\r" +sleep 1 + +send -- "rm -fr ~/_firejail_test_dir\r" +after 100 + +puts "\nall done\n" -- cgit v1.2.3-70-g09d2