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