diff options
Diffstat (limited to 'test/filters/seccomp-numeric.exp')
-rwxr-xr-x | test/filters/seccomp-numeric.exp | 44 |
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 | |||
6 | set timeout 10 | ||
7 | spawn $env(SHELL) | ||
8 | match_max 100000 | ||
9 | |||
10 | send -- "touch seccomp-test-file\r" | ||
11 | after 100 | ||
12 | |||
13 | send -- "firejail --seccomp=unlinkat:ENOENT,mkdir:ENOENT rm seccomp-test-file\r" | ||
14 | expect { | ||
15 | timeout {puts "TESTING ERROR 0\n";exit} | ||
16 | "No such file or directory" | ||
17 | } | ||
18 | after 100 | ||
19 | |||
20 | send -- "firejail --seccomp=\\\$263:ENOENT,mkdir:ENOENT rm seccomp-test-file\r" | ||
21 | expect { | ||
22 | timeout {puts "TESTING ERROR 1\n";exit} | ||
23 | "No such file or directory" | ||
24 | } | ||
25 | after 100 | ||
26 | |||
27 | send -- "firejail --seccomp=unlinkat:ENOENT,mkdir:ENOENT mkdir seccomp-test-dir\r" | ||
28 | expect { | ||
29 | timeout {puts "TESTING ERROR 2\n";exit} | ||
30 | "No such file or directory" | ||
31 | } | ||
32 | after 100 | ||
33 | |||
34 | send -- "firejail --seccomp=unlinkat:ENOENT,\\\$83:ENOENT mkdir seccomp-test-dir\r" | ||
35 | expect { | ||
36 | timeout {puts "TESTING ERROR 3\n";exit} | ||
37 | "No such file or directory" | ||
38 | } | ||
39 | after 100 | ||
40 | |||
41 | send -- "rm seccomp-test-file\r" | ||
42 | #send -- "rm -fr seccomp-test-dir\r" | ||
43 | after 100 | ||
44 | puts "all done\n" | ||