From 80d0d452d660f2c77af94fc35d2caaea7cfd1cae Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sun, 1 Apr 2018 10:41:00 -0400 Subject: testing --- test/root/firecfg.exp | 6 +++--- test/root/root.sh | 28 +++++++++++++++++----------- test/utils/build.exp | 33 +++++++++++++++++++++++++++++++++ test/utils/utils.sh | 4 ++++ 4 files changed, 57 insertions(+), 14 deletions(-) (limited to 'test') diff --git a/test/root/firecfg.exp b/test/root/firecfg.exp index 656b8e215..b73167bd1 100755 --- a/test/root/firecfg.exp +++ b/test/root/firecfg.exp @@ -7,10 +7,10 @@ set timeout 10 spawn $env(SHELL) match_max 100000 -send -- "firecfg\r" +send -- "firecfg --debug\r" sleep 1 -send -- "firecfg --clean\r" +send -- "firecfg --debug --clean\r" expect { timeout {puts "TESTING ERROR 0\n";exit} "less removed" @@ -27,7 +27,7 @@ expect { } sleep 1 -send -- "firecfg\r" +send -- "firecfg --debug\r" expect { timeout {puts "TESTING ERROR 3\n";exit} "less created" diff --git a/test/root/root.sh b/test/root/root.sh index 22b12cf86..d77982993 100755 --- a/test/root/root.sh +++ b/test/root/root.sh @@ -3,6 +3,23 @@ # set a new firejail config file #cp firejail.config /etc/firejail/firejail.config + +#******************************** +# firecfg +#******************************** +which less +if [ "$?" -eq 0 ]; +then + echo "TESTING: firecfg (test/root/firecfg.exp)" + rm -fr /home/netblue/.local/share/applications-store + mv /home/netblue/.local/share/applications /home/netblue/.local/share/applications-store + ./firecfg.exp + rm -fr /home/netblue/.local/share/applications + mv /home/netblue/.local/share/applications-store /home/netblue/.local/share/applications +else + echo "TESTING SKIP: firecfg, less not found" +fi + #******************************** # servers #******************************** @@ -107,17 +124,6 @@ rm -f tmpfile echo "TESTING: firemon events (test/root/firemon-events.exp)" ./firemon-events.exp -#******************************** -# firecfg -#******************************** -which less -if [ "$?" -eq 0 ]; -then - echo "TESTING: firecfg (test/root/firecfg.exp)" - ./firecfg.exp -else - echo "TESTING SKIP: firecfg, less not found" -fi # restore the default config file #cp ../../etc/firejail.config /etc/firejail/firejail.config diff --git a/test/utils/build.exp b/test/utils/build.exp index de2a9b6ae..5e883e4ba 100755 --- a/test/utils/build.exp +++ b/test/utils/build.exp @@ -54,5 +54,38 @@ expect { } after 100 +send -- "firejail --build cat /etc/passwd\r" +expect { + timeout {puts "TESTING ERROR 10\n";exit} + "private-etc passwd," +} +after 100 + +send -- "firejail --build cat /var/tmp/firejail-test-file-7699\r" +expect { + timeout {puts "TESTING ERROR 11\n";exit} + "whitelist /var/tmp/firejail-test-file-7699" +} +after 100 + +send -- "firejail --build man firejail\r" +expect { + timeout {puts "TESTING ERROR 12\n";exit} + "whitelist /usr/share/man" +} +after 100 + +send -- "firejail --build wget blablabla\r" +expect { + timeout {puts "TESTING ERROR 13\n";exit} + "protocol inet" +} +after 100 + + +send -- "firejail --build cat /tmp/firejail-test-file-7699\r" +#todo - bug: it comes back with private-tmp +sleep 1 + puts "all done\n" diff --git a/test/utils/utils.sh b/test/utils/utils.sh index 9259ee33a..5438e11a8 100755 --- a/test/utils/utils.sh +++ b/test/utils/utils.sh @@ -13,9 +13,13 @@ fi export PATH="$PATH:/usr/lib/firejail" echo "testing" > ~/firejail-test-file-7699 +echo "testing" > /tmp/firejail-test-file-7699 +echo "testing" > /var/tmp/firejail-test-file-7699 echo "TESTING: build (test/utils/build.exp)" ./build.exp rm -f ~/firejail-test-file-7699 +rm -f /tmp/firejail-test-file-7699 +rm -f /var/tmp/firejail-test-file-7699 echo "TESTING: audit (test/utils/audit.exp)" ./audit.exp -- cgit v1.2.3-70-g09d2