From 1c539a83dd277a7627af995f90565dadc73872a2 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sat, 19 Nov 2016 07:10:51 -0500 Subject: testing --- test/environment/environment.sh | 11 +++++++++++ test/environment/ibus.exp | 28 ++++++++++++++++++++++++++++ test/fs/private-bin.exp | 22 ++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100755 test/environment/ibus.exp (limited to 'test') diff --git a/test/environment/environment.sh b/test/environment/environment.sh index 5c4d49331..c2a6c435a 100755 --- a/test/environment/environment.sh +++ b/test/environment/environment.sh @@ -6,6 +6,7 @@ export MALLOC_CHECK_=3 export MALLOC_PERTURB_=$(($RANDOM % 255 + 1)) + echo "TESTING: DNS (test/environment/dns.exp)" ./dns.exp @@ -85,3 +86,13 @@ else echo "TESTING SKIP: strace not found" fi +# to install ibus: +# $ sudo apt-get install ibus-table-array30 +# $ ibus-setup + +find ~/.config/ibus/bus | grep unix-0 +if [ "$?" -eq 0 ]; +then + echo "TESTING: ibus (test/environment/ibus.exp)" + ./ibus.exp +fi diff --git a/test/environment/ibus.exp b/test/environment/ibus.exp new file mode 100755 index 000000000..4344011a6 --- /dev/null +++ b/test/environment/ibus.exp @@ -0,0 +1,28 @@ +#!/usr/bin/expect -f + +set timeout 10 +cd /home +spawn $env(SHELL) +match_max 100000 + +send -- "firejail\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Child process initialized" +} +after 100 + +send -- "env | grep IBUS\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + "IBUS_ADDRESS" +} +expect { + timeout {puts "TESTING ERROR 2\n";exit} + "IBUS_DAEMON_PID" +} +after 100 + + +puts "\nall done\n" + diff --git a/test/fs/private-bin.exp b/test/fs/private-bin.exp index fe9468be9..f7181d218 100755 --- a/test/fs/private-bin.exp +++ b/test/fs/private-bin.exp @@ -65,6 +65,28 @@ expect { "sh" } send -- "exit\r" +after 100 + + +send -- "firejail --private-bin=/etc/shadow\r" +expect { + timeout {puts "TESTING ERROR 8\n";exit} + "invalid filename" +} +after 100 + +send -- "firejail --private-bin=\"bla;bla\"\r" +expect { + timeout {puts "TESTING ERROR 9\n";exit} + "is an invalid filename" +} +after 100 + +send -- "firejail --private-etc=../bin/ls\r" +expect { + timeout {puts "TESTING ERROR 10\n";exit} + "is an invalid filename" +} after 100 puts "\nall done\n" -- cgit v1.2.3-54-g00ecf