aboutsummaryrefslogtreecommitdiffstats
path: root/test/filters/seccomp-errno.exp
diff options
context:
space:
mode:
Diffstat (limited to 'test/filters/seccomp-errno.exp')
-rwxr-xr-xtest/filters/seccomp-errno.exp54
1 files changed, 54 insertions, 0 deletions
diff --git a/test/filters/seccomp-errno.exp b/test/filters/seccomp-errno.exp
new file mode 100755
index 000000000..c3af2fbe9
--- /dev/null
+++ b/test/filters/seccomp-errno.exp
@@ -0,0 +1,54 @@
1#!/usr/bin/expect -f
2# This file is part of Firejail project
3# Copyright (C) 2014-2016 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 rm seccomp-test-file\r"
14expect {
15 timeout {puts "TESTING ERROR 0\n";exit}
16 "No such file or directory"
17}
18sleep 1
19
20send -- "firejail --seccomp=unlinkat:ENOENT --debug rm seccomp-test-file\r"
21expect {
22 timeout {puts "TESTING ERROR 1\n";exit}
23 "unlinkat 2 ENOENT"
24}
25sleep 1
26
27send -- "firejail --seccomp=unlinkat:ENOENT,mkdir:ENOENT\r"
28expect {
29 timeout {puts "TESTING ERROR 2\n";exit}
30 "Child process initialized"
31}
32sleep 1
33send -- "rm seccomp-test-file\r"
34expect {
35 timeout {puts "TESTING ERROR 3\n";exit}
36 "No such file or directory"
37}
38after 100
39puts "\n"
40
41send -- "mkdir seccomp-test-dir\r"
42expect {
43 timeout {puts "TESTING ERROR 4\n";exit}
44 "No such file or directory"
45}
46after 100
47puts "\n"
48
49send -- "exit\r"
50sleep 1
51
52send -- "rm seccomp-test-file\r"
53after 100
54puts "all done\n"