From 113597818860241185d0c3efecf99b0ee7d900fa Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sun, 25 Oct 2015 08:22:21 -0400 Subject: ignore option testing --- test/ignore.exp | 38 ++++++++++++++++++++++++++++++++++++++ test/ignore.profile | 3 +++ test/test.sh | 3 +++ 3 files changed, 44 insertions(+) create mode 100755 test/ignore.exp create mode 100644 test/ignore.profile (limited to 'test') diff --git a/test/ignore.exp b/test/ignore.exp new file mode 100755 index 000000000..bdbd9d28c --- /dev/null +++ b/test/ignore.exp @@ -0,0 +1,38 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "firejail --profile=ignore.profile --ignore=seccomp \r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "Error: please use --profile after --include" +} + +send -- "firejail --debug --ignore=seccomp\r" +expect { + timeout {puts "TESTING ERROR 1\n";exit} + BLACKLIST {puts "TESTING ERROR 2\n";exit} + "Child process initialized" +} +sleep 1 +send -- "exit\r" +sleep 1 + +send -- "firejail --ignore=seccomp --ignore=shell --profile=ignore.profile \r" +expect { + timeout {puts "TESTING ERROR 3\n";exit} + "Child process initialized" +} +sleep 1 + +send -- "ps aux | wc -l\r" +expect { + timeout {puts "TESTING ERROR 4\n";exit} + "4" +} +sleep 1 + + +puts "\nall done\n" diff --git a/test/ignore.profile b/test/ignore.profile new file mode 100644 index 000000000..aec231ad2 --- /dev/null +++ b/test/ignore.profile @@ -0,0 +1,3 @@ +private +seccomp +shell none diff --git a/test/test.sh b/test/test.sh index c986b5f29..406ef92a3 100755 --- a/test/test.sh +++ b/test/test.sh @@ -18,6 +18,9 @@ echo "TESTING: invalid filename" echo "TESTING: environment variables" ./env.exp +echo "TESTING: ignore command" +./ignore.exp + echo "TESTING: private-etc" ./private-etc.exp -- cgit v1.2.3-70-g09d2