diff options
Diffstat (limited to 'test/seccomp-errno.exp')
-rwxr-xr-x | test/seccomp-errno.exp | 28 |
1 files changed, 28 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" | ||