From ef1d3bdf44305f71070978c772344ab1244b5d3f Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sun, 23 Aug 2015 08:03:47 -0400 Subject: private-home testing --- test/private-keep.exp | 126 +++++++++++++++++++++++++++++++++++++++++++++- test/private-keep.profile | 2 +- 2 files changed, 126 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/private-keep.exp b/test/private-keep.exp index cdae12ac3..027020ce9 100755 --- a/test/private-keep.exp +++ b/test/private-keep.exp @@ -4,7 +4,8 @@ set timeout 10 spawn $env(SHELL) match_max 100000 -send -- "firejail --private.keep=.mozilla,.config/firejail\r" +#************************************************************** +send -- "firejail --private-home=.mozilla,.config/firejail\r" expect { timeout {puts "TESTING ERROR 0\n";exit} "Child process initialized" @@ -37,6 +38,7 @@ send -- "exit\r" sleep 2 +#************************************************************** send -- "firejail --profile=private-keep.profile\r" expect { timeout {puts "TESTING ERROR 1.0\n";exit} @@ -64,3 +66,125 @@ expect { timeout {puts "TESTING ERROR 1.4\n";exit} ".config/firejail" } +sleep 1 +puts "\n" +send -- "exit\r" +sleep 2 + + +#************************************************************** +send -- "firejail --private-home=~/.mozilla,~/.config/firejail\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -al\r" +expect { + timeout {puts "TESTING ERROR 2.1\n";exit} + ".config" +} +expect { + timeout {puts "TESTING ERROR 2.2\n";exit} + ".mozilla" +} +sleep 1 + +send -- "find .config\r" +expect { + timeout {puts "TESTING ERROR 2.3\n";exit} + ".config" +} +expect { + timeout {puts "TESTING ERROR 2.4\n";exit} + ".config/firejail" +} +sleep 1 +puts "\n" +send -- "exit\r" +sleep 2 + + +#************************************************************** +send -- "firejail --private-home=~/.mozilla,~/.config/firejail\r" +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -al\r" +expect { + timeout {puts "TESTING ERROR 2.1\n";exit} + ".config" +} +expect { + timeout {puts "TESTING ERROR 2.2\n";exit} + ".mozilla" +} +sleep 1 + +send -- "find .config\r" +expect { + timeout {puts "TESTING ERROR 2.3\n";exit} + ".config" +} +expect { + timeout {puts "TESTING ERROR 2.4\n";exit} + ".config/firejail" +} +sleep 1 +puts "\n" +send -- "exit\r" +sleep 2 + +#************************************************************** +send -- "firejail --private-home=/home/netblue/.mozilla,/home/netblue/.config/firejail\r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ls -al\r" +expect { + timeout {puts "TESTING ERROR 3.1\n";exit} + ".config" +} +expect { + timeout {puts "TESTING ERROR 3.2\n";exit} + ".mozilla" +} +sleep 1 + +send -- "find .config\r" +expect { + timeout {puts "TESTING ERROR 3.3\n";exit} + ".config" +} +expect { + timeout {puts "TESTING ERROR 3.4\n";exit} + ".config/firejail" +} +sleep 1 +puts "\n" +send -- "exit\r" +sleep 2 + +#************************************************************** +send -- "firejail --private-home=/home/netblue/../netblue/.mozilla,/home/netblue/.config/firejail\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "Error: invalid private-home list" +} +sleep 1 + +#************************************************************** +send -- "firejail --private-home=/root\r" +expect { + timeout {puts "TESTING ERROR 5\n";exit} + "Error: only files or directories created by the current user are allowed" +} +sleep 1 + diff --git a/test/private-keep.profile b/test/private-keep.profile index 7f842cc04..a968c4ce2 100644 --- a/test/private-keep.profile +++ b/test/private-keep.profile @@ -1 +1 @@ -private.keep .mozilla,.config/firejail +private-home .mozilla,.config/firejail -- cgit v1.2.3-70-g09d2