aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xtest/seccomp-errno.exp28
-rwxr-xr-xtest/test.sh3
2 files changed, 31 insertions, 0 deletions
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 @@
1#!/usr/bin/expect -f
2
3set timeout 10
4spawn $env(SHELL)
5match_max 100000
6
7send -- "touch seccomp-test-file\r"
8sleep 1
9
10send -- "firejail --seccomp.enoent=unlinkat rm seccomp-test-file\r"
11expect {
12 timeout {puts "TESTING ERROR 0\n";exit}
13 "No such file or directory"
14}
15
16sleep 1
17
18send -- "firejail --seccomp.enoent=unlinkat --debug rm seccomp-test-file\r"
19expect {
20 timeout {puts "TESTING ERROR 0\n";exit}
21 "ERRNO 263 unlinkat 2 ENOENT"
22}
23
24sleep 1
25
26send -- "rm seccomp-test-file\r"
27sleep 1
28puts "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
261echo "TESTING: seccomp debug" 261echo "TESTING: seccomp debug"
262./seccomp-debug.exp 262./seccomp-debug.exp
263 263
264echo "TESTING: seccomp errno"
265./seccomp-errno.exp
266
264echo "TESTING: seccomp su" 267echo "TESTING: seccomp su"
265./seccomp-su.exp 268./seccomp-su.exp
266 269