From 13af4d76ee0e86b6a74cda3365f41b83b1651a95 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sun, 29 Apr 2018 10:02:47 -0400 Subject: testing --- test/arguments/arguments.sh | 3 +- test/filters/filters.sh | 4 +-- test/fs/invalid_filename.exp | 79 ++++++++------------------------------------ 3 files changed, 16 insertions(+), 70 deletions(-) diff --git a/test/arguments/arguments.sh b/test/arguments/arguments.sh index 9500b5975..d9f2d4697 100755 --- a/test/arguments/arguments.sh +++ b/test/arguments/arguments.sh @@ -3,9 +3,8 @@ if [ -f /etc/debian_version ]; then libdir=$(dirname "$(dpkg -L firejail | grep faudit)") export PATH="$PATH:$libdir" -else - export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail" fi +export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail" echo "TESTING: 1. regular bash session" ./bashrun.exp diff --git a/test/filters/filters.sh b/test/filters/filters.sh index ff197aa54..d0a34ccc5 100755 --- a/test/filters/filters.sh +++ b/test/filters/filters.sh @@ -9,9 +9,9 @@ export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) if [ -f /etc/debian_version ]; then libdir=$(dirname "$(dpkg -L firejail | grep fseccomp)") export PATH="$PATH:$libdir" -else - export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail" fi +export PATH="$PATH:/usr/lib/firejail:/usr/lib64/firejail" + if [ "$(uname -m)" = "x86_64" ]; then echo "TESTING: memory-deny-write-execute (test/filters/memwrexe.exp)" diff --git a/test/fs/invalid_filename.exp b/test/fs/invalid_filename.exp index e16798ab8..84abe74cd 100755 --- a/test/fs/invalid_filename.exp +++ b/test/fs/invalid_filename.exp @@ -7,11 +7,7 @@ set timeout 10 spawn $env(SHELL) match_max 100000 -send -- "firejail --debug-check-filename --noprofile --blacklist=\"bla&&bla\"\r" -expect { - timeout {puts "TESTING ERROR 1.1\n";exit} - "Checking filename bla&&bla" -} +send -- "firejail --noprofile --blacklist=\"bla&&bla\"\r" expect { timeout {puts "TESTING ERROR 1.2\n";exit} "Error:" @@ -22,11 +18,7 @@ expect { } after 100 -send -- "firejail --debug-check-filename --noprofile --cgroup=\"bla&&bla\"\r" -expect { - timeout {puts "TESTING ERROR 2.1\n";exit} - "Checking filename bla&&bla" -} +send -- "firejail --noprofile --cgroup=\"bla&&bla\"\r" expect { timeout {puts "TESTING ERROR 2.2\n";exit} "Error:" @@ -37,12 +29,7 @@ expect { } after 100 -send -- "firejail --debug-check-filename --noprofile --chroot=\"bla&&bla\"\r" -expect { - timeout {puts "TESTING ERROR 3.1\n";exit} - "Checking filename bla&&bla" {puts "normal system\n"} - "Error: --chroot option is not available on Grsecurity systems" { puts "\nall done\n"; exit} -} +send -- "firejail --noprofile --chroot=\"bla&&bla\"\r" expect { timeout {puts "TESTING ERROR 3.2\n";exit} "Error:" @@ -53,11 +40,7 @@ expect { } after 100 -send -- "firejail --debug-check-filename --noprofile --netfilter=\"bla&&bla\"\r" -expect { - timeout {puts "TESTING ERROR 4.1\n";exit} - "Checking filename bla&&bla" -} +send -- "firejail --noprofile --netfilter=\"bla&&bla\"\r" expect { timeout {puts "TESTING ERROR 4.2\n";exit} "Error:" @@ -68,22 +51,14 @@ expect { } after 100 -send -- "firejail --debug-check-filename --noprofile --output=\"bla&&bla\"\r" -expect { - timeout {puts "TESTING ERROR 5.2\n";exit} - "Error:" -} +send -- "firejail --noprofile --output=\"bla&&bla\"\r" expect { timeout {puts "TESTING ERROR 5.3\n";exit} "is an invalid filename" } after 100 -send -- "firejail --debug-check-filename --noprofile --private=\"bla&&bla\"\r" -expect { - timeout {puts "TESTING ERROR 6.1\n";exit} - "Checking filename bla&&bla" -} +send -- "firejail --noprofile --private=\"bla&&bla\"\r" expect { timeout {puts "TESTING ERROR 6.2\n";exit} "Error:" @@ -94,11 +69,7 @@ expect { } after 100 -send -- "firejail --debug-check-filename --noprofile --private-bin=\"bla&&bla\"\r" -expect { - timeout {puts "TESTING ERROR 7.1\n";exit} - "Checking filename bla&&bla" -} +send -- "firejail --noprofile --private-bin=\"bla&&bla\"\r" expect { timeout {puts "TESTING ERROR 7.2\n";exit} "Error:" @@ -109,11 +80,7 @@ expect { } after 100 -send -- "firejail --debug-check-filename --noprofile --private-home=\"bla&&bla\"\r" -expect { - timeout {puts "TESTING ERROR 8.1\n";exit} - "Checking filename bla&&bla" -} +send -- "firejail --noprofile --private-home=\"bla&&bla\"\r" expect { timeout {puts "TESTING ERROR 8.2\n";exit} "Error:" @@ -124,11 +91,7 @@ expect { } after 100 -send -- "firejail --debug-check-filename --noprofile --private-etc=\"bla&&bla\"\r" -expect { - timeout {puts "TESTING ERROR 9.1\n";exit} - "Checking filename bla&&bla" -} +send -- "firejail --noprofile --private-etc=\"bla&&bla\"\r" expect { timeout {puts "TESTING ERROR 9.2\n";exit} "Error:" @@ -139,11 +102,7 @@ expect { } after 100 -send -- "firejail --debug-check-filename --profile=\"bla&&bla\"\r" -expect { - timeout {puts "TESTING ERROR 10.1\n";exit} - "Checking filename bla&&bla" -} +send -- "firejail --profile=\"bla&&bla\"\r" expect { timeout {puts "TESTING ERROR 10.2\n";exit} "Error:" @@ -154,11 +113,7 @@ expect { } after 100 -send -- "firejail --debug-check-filename --read-only=\"bla&&bla\"\r" -expect { - timeout {puts "TESTING ERROR 11.1\n";exit} - "Checking filename bla&&bla" -} +send -- "firejail --read-only=\"bla&&bla\"\r" expect { timeout {puts "TESTING ERROR 11.2\n";exit} "Error:" @@ -169,11 +124,7 @@ expect { } after 100 -send -- "firejail --debug-check-filename --shell=\"bla&&bla\"\r" -expect { - timeout {puts "TESTING ERROR 12.1\n";exit} - "Checking filename bla&&bla" -} +send -- "firejail --shell=\"bla&&bla\"\r" expect { timeout {puts "TESTING ERROR 12.2\n";exit} "Error:" @@ -185,11 +136,7 @@ expect { after 100 -send -- "firejail --debug-check-filename --whitelist=\"bla&&bla\"\r" -expect { - timeout {puts "TESTING ERROR 14.1\n";exit} - "Checking filename bla&&bla" -} +send -- "firejail --whitelist=\"bla&&bla\"\r" expect { timeout {puts "TESTING ERROR 14.2\n";exit} "Error:" -- cgit v1.2.3-70-g09d2