summaryrefslogtreecommitdiffstats
path: root/test/filters/seccomp-numeric.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/filters/seccomp-numeric.exp')
-rwxr-xr-xtest/filters/seccomp-numeric.exp44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/filters/seccomp-numeric.exp b/test/filters/seccomp-numeric.exp
new file mode 100755
index 000000000..77f6d60b0
--- /dev/null
+++ b/test/filters/seccomp-numeric.exp
@@ -0,0 +1,44 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2019 Firejail Authors
4# License GPL v2
5
6set timeout 10
7spawn $env(SHELL)
8match_max 100000
9
10send -- "touch seccomp-test-file\r"
11after 100
12
13send -- "firejail --seccomp=unlinkat:ENOENT,mkdir:ENOENT rm seccomp-test-file\r"
14expect {
15 timeout {puts "TESTING ERROR 0\n";exit}
16 "No such file or directory"
17}
18after 100
19
20send -- "firejail --seccomp=\\\$263:ENOENT,mkdir:ENOENT rm seccomp-test-file\r"
21expect {
22 timeout {puts "TESTING ERROR 1\n";exit}
23 "No such file or directory"
24}
25after 100
26
27send -- "firejail --seccomp=unlinkat:ENOENT,mkdir:ENOENT mkdir seccomp-test-dir\r"
28expect {
29 timeout {puts "TESTING ERROR 2\n";exit}
30 "No such file or directory"
31}
32after 100
33
34send -- "firejail --seccomp=unlinkat:ENOENT,\\\$83:ENOENT mkdir seccomp-test-dir\r"
35expect {
36 timeout {puts "TESTING ERROR 3\n";exit}
37 "No such file or directory"
38}
39after 100
40
41send -- "rm seccomp-test-file\r"
42#send -- "rm -fr seccomp-test-dir\r"
43after 100
44puts "all done\n"