From 444207531c1280803dca864fad5c7208fade90d7 Mon Sep 17 00:00:00 2001 From: netblue30 Date: Sat, 26 Sep 2015 09:54:55 -0400 Subject: seccomp testing --- test/seccomp-errno.exp | 28 ++++++++++++++++++++++++++++ test/test.sh | 3 +++ 2 files changed, 31 insertions(+) create mode 100755 test/seccomp-errno.exp (limited to 'test') diff --git a/test/seccomp-errno.exp b/test/seccomp-errno.exp new file mode 100755 index 000000000..e69b89c7a --- /dev/null +++ b/test/seccomp-errno.exp @@ -0,0 +1,28 @@ +#!/usr/bin/expect -f + +set timeout 10 +spawn $env(SHELL) +match_max 100000 + +send -- "touch seccomp-test-file\r" +sleep 1 + +send -- "firejail --seccomp.enoent=unlinkat rm seccomp-test-file\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "No such file or directory" +} + +sleep 1 + +send -- "firejail --seccomp.enoent=unlinkat --debug rm seccomp-test-file\r" +expect { + timeout {puts "TESTING ERROR 0\n";exit} + "ERRNO 263 unlinkat 2 ENOENT" +} + +sleep 1 + +send -- "rm seccomp-test-file\r" +sleep 1 +puts "all done\n" diff --git a/test/test.sh b/test/test.sh index 8d49468b3..61dd58f9e 100755 --- a/test/test.sh +++ b/test/test.sh @@ -261,6 +261,9 @@ fi echo "TESTING: seccomp debug" ./seccomp-debug.exp +echo "TESTING: seccomp errno" +./seccomp-errno.exp + echo "TESTING: seccomp su" ./seccomp-su.exp -- cgit v1.2.3-70-g09d2