From 759dc6ade2bcb7408dbbf3dc31230fc7534ca29d Mon Sep 17 00:00:00 2001 From: netblue30 Date: Mon, 19 Dec 2016 10:24:25 -0500 Subject: testing --- test/fs/private-home-dir.exp | 62 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) (limited to 'test/fs/private-home-dir.exp') diff --git a/test/fs/private-home-dir.exp b/test/fs/private-home-dir.exp index 5491be834..f85a939b1 100755 --- a/test/fs/private-home-dir.exp +++ b/test/fs/private-home-dir.exp @@ -21,6 +21,8 @@ if {[file exists ~/.Xauthority]} { send -- "touch ~/.Xauthority\r" } after 100 +send -- "rm -fr ~/_firejail_test_dir_\r" +after 100 send -- "mkdir ~/_firejail_test_dir_\r" sleep 1 @@ -65,6 +67,64 @@ expect { "private directory should be owned by the current user" } sleep 1 +send -- "mkdir ~/_firejail_test_dir_/test_dir_2\r" +after 100 +send -- "touch ~/_firejail_test_dir_/test_dir_2/testfile\r" +sleep 1 +send -- "firejail --debug --noprofile --blacklist=~/test_dir_2 --private=~/_firejail_test_dir_\r" +expect { + timeout {puts "TESTING ERROR 6\n";exit} + "Not blacklist" +} +expect { + timeout {puts "TESTING ERROR 7\n";exit} + "test_dir_2" +} +expect { + timeout {puts "TESTING ERROR 8\n";exit} + "Child process initialized" +} + +sleep 1 + +send -- "find ~\r" +expect { + timeout {puts "TESTING ERROR 9\n";exit} + "testfile" +} +after 100 + +send -- "exit\r" +sleep 1 + +send -- "firejail --debug --noprofile --allow-private-blacklist --blacklist=~/test_dir_2 --private=~/_firejail_test_dir_\r" +expect { + timeout {puts "TESTING ERROR 10\n";exit} + "Disable" +} +expect { + timeout {puts "TESTING ERROR 11\n";exit} + "test_dir_2" +} +expect { + timeout {puts "TESTING ERROR 12\n";exit} + "Child process initialized" +} + +sleep 1 + +send -- "ls ~/test_dir_2\r" +expect { + timeout {puts "TESTING ERROR 13\n";exit} + "cannot open directory" +} +after 100 + +send "exit\r" +sleep 1 + +send -- "rm -fr ~/_firejail_test_dir_\r" +after 100 -puts "all done\n" +puts "\nall done\n" -- cgit v1.2.3-70-g09d2