From cb585cc82af4318a888470a7da82cc89dd01774d Mon Sep 17 00:00:00 2001 From: netblue30 Date: Thu, 20 Aug 2015 09:06:07 -0400 Subject: testing --- test/blacklist.exp | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100755 test/blacklist.exp (limited to 'test/blacklist.exp') diff --git a/test/blacklist.exp b/test/blacklist.exp new file mode 100755 index 000000000..70012d167 --- /dev/null +++ b/test/blacklist.exp @@ -0,0 +1,76 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +# directory with ~ +send -- "firejail --blacklist=~/.config\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -al ~/.config\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "cannot open directory" +} + +send -- "exit\r" +sleep 1 + +# directory with ~ in profile file +send -- "firejail --profile=blacklist1.profile\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -al ~/.config\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "cannot open directory" +} + +send -- "exit\r" +sleep 1 + + +# directory with space +send -- "firejail \"--blacklist=dir with space\"\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -al \"dir with space\"\r" +expect { + timeout {puts "TESTING ERROR 6\n";exit} + "cannot open directory" +} + +send -- "exit\r" +sleep 1 + +# directory with space in profile +send -- "firejail --profile=blacklist2.profile\r" +expect { + timeout {puts "TESTING ERROR 7\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -al \"dir with space\"\r" +expect { + timeout {puts "TESTING ERROR 8\n";exit} + "cannot open directory" +} + + + +puts "\n" + -- cgit v1.2.3-54-g00ecf