aboutsummaryrefslogtreecommitdiffstats
path: root/test/filters
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2016-11-06 13:14:53 -0500
committerLibravatar netblue30 <netblue30@yahoo.com>2016-11-06 13:14:53 -0500
commit322ce2cdc98cf3eec22ebd0f83296ddde8347d09 (patch)
tree035026b607ee8b34a9ea03a6f1df30d03c584f43 /test/filters
parentcleanup (diff)
downloadfirejail-322ce2cdc98cf3eec22ebd0f83296ddde8347d09.tar.gz
firejail-322ce2cdc98cf3eec22ebd0f83296ddde8347d09.tar.zst
firejail-322ce2cdc98cf3eec22ebd0f83296ddde8347d09.zip
seccomp rework
Diffstat (limited to 'test/filters')
-rwxr-xr-xtest/filters/seccomp-errno.exp44
1 files changed, 4 insertions, 40 deletions
diff --git a/test/filters/seccomp-errno.exp b/test/filters/seccomp-errno.exp
index 4df1948be..c3af2fbe9 100755
--- a/test/filters/seccomp-errno.exp
+++ b/test/filters/seccomp-errno.exp
@@ -8,23 +8,23 @@ spawn $env(SHELL)
8match_max 100000 8match_max 100000
9 9
10send -- "touch seccomp-test-file\r" 10send -- "touch seccomp-test-file\r"
11sleep 1 11after 100
12 12
13send -- "firejail --seccomp.enoent=unlinkat rm seccomp-test-file\r" 13send -- "firejail --seccomp=unlinkat:ENOENT rm seccomp-test-file\r"
14expect { 14expect {
15 timeout {puts "TESTING ERROR 0\n";exit} 15 timeout {puts "TESTING ERROR 0\n";exit}
16 "No such file or directory" 16 "No such file or directory"
17} 17}
18sleep 1 18sleep 1
19 19
20send -- "firejail --seccomp.enoent=unlinkat --debug rm seccomp-test-file\r" 20send -- "firejail --seccomp=unlinkat:ENOENT --debug rm seccomp-test-file\r"
21expect { 21expect {
22 timeout {puts "TESTING ERROR 1\n";exit} 22 timeout {puts "TESTING ERROR 1\n";exit}
23 "unlinkat 2 ENOENT" 23 "unlinkat 2 ENOENT"
24} 24}
25sleep 1 25sleep 1
26 26
27send -- "firejail --seccomp.enoent=unlinkat,mkdir\r" 27send -- "firejail --seccomp=unlinkat:ENOENT,mkdir:ENOENT\r"
28expect { 28expect {
29 timeout {puts "TESTING ERROR 2\n";exit} 29 timeout {puts "TESTING ERROR 2\n";exit}
30 "Child process initialized" 30 "Child process initialized"
@@ -49,42 +49,6 @@ puts "\n"
49send -- "exit\r" 49send -- "exit\r"
50sleep 1 50sleep 1
51 51
52
53send -- "firejail --seccomp.enoent=unlinkat --seccomp.enoent=mkdir\r"
54expect {
55 timeout {puts "TESTING ERROR 5\n";exit}
56 "errno enoent already configured"
57}
58sleep 1
59
60send -- "firejail --seccomp.enoent=unlinkat --seccomp.eperm=mkdir\r"
61expect {
62 timeout {puts "TESTING ERROR 6\n";exit}
63 "Child process initialized"
64}
65sleep 1
66send -- "rm seccomp-test-file\r"
67expect {
68 timeout {puts "TESTING ERROR 7\n";exit}
69 "No such file or directory"
70}
71after 100
72puts "\n"
73
74send -- "mkdir seccomp-test-dir\r"
75expect {
76 timeout {puts "TESTING ERROR 8\n";exit}
77 "Operation not permitted"
78}
79after 100
80puts "\n"
81
82send -- "exit\r"
83sleep 1
84
85
86
87
88send -- "rm seccomp-test-file\r" 52send -- "rm seccomp-test-file\r"
89after 100 53after 100
90puts "all done\n" 54puts "all done\n"