aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLibravatar netblue30 <netblue30@yahoo.com>2015-09-27 08:00:06 -0400
committerLibravatar netblue30 <netblue30@yahoo.com>2015-09-27 08:00:06 -0400
commit200b205b69f9a6874e55bf76ca876d2c4fcee4ac (patch)
treecb99a492f5a4da38a4254677d7094a1fece3dc2c /test
parentseccomp errno: man page and usage (diff)
downloadfirejail-200b205b69f9a6874e55bf76ca876d2c4fcee4ac.tar.gz
firejail-200b205b69f9a6874e55bf76ca876d2c4fcee4ac.tar.zst
firejail-200b205b69f9a6874e55bf76ca876d2c4fcee4ac.zip
seccomp errno testing
Diffstat (limited to 'test')
-rwxr-xr-xtest/seccomp-errno.exp63
1 files changed, 61 insertions, 2 deletions
diff --git a/test/seccomp-errno.exp b/test/seccomp-errno.exp
index e69b89c7a..138f039b0 100755
--- a/test/seccomp-errno.exp
+++ b/test/seccomp-errno.exp
@@ -12,17 +12,76 @@ expect {
12 timeout {puts "TESTING ERROR 0\n";exit} 12 timeout {puts "TESTING ERROR 0\n";exit}
13 "No such file or directory" 13 "No such file or directory"
14} 14}
15
16sleep 1 15sleep 1
17 16
18send -- "firejail --seccomp.enoent=unlinkat --debug rm seccomp-test-file\r" 17send -- "firejail --seccomp.enoent=unlinkat --debug rm seccomp-test-file\r"
19expect { 18expect {
20 timeout {puts "TESTING ERROR 0\n";exit} 19 timeout {puts "TESTING ERROR 1\n";exit}
21 "ERRNO 263 unlinkat 2 ENOENT" 20 "ERRNO 263 unlinkat 2 ENOENT"
22} 21}
22sleep 1
23
24send -- "firejail --seccomp.enoent=unlinkat,mkdir\r"
25expect {
26 timeout {puts "TESTING ERROR 2\n";exit}
27 "Child process initialized"
28}
29sleep 1
30send -- "rm seccomp-test-file\r"
31expect {
32 timeout {puts "TESTING ERROR 3\n";exit}
33 "No such file or directory"
34}
35after 100
36puts "\n"
37
38send -- "mkdir seccomp-test-dir\r"
39expect {
40 timeout {puts "TESTING ERROR 4\n";exit}
41 "No such file or directory"
42}
43after 100
44puts "\n"
45
46send -- "exit\r"
47sleep 1
48
49
50send -- "firejail --seccomp.enoent=unlinkat --seccomp.enoent=mkdir\r"
51expect {
52 timeout {puts "TESTING ERROR 5\n";exit}
53 "errno enoent already configured"
54}
55sleep 1
56
57send -- "firejail --seccomp.enoent=unlinkat --seccomp.eperm=mkdir\r"
58expect {
59 timeout {puts "TESTING ERROR 6\n";exit}
60 "Child process initialized"
61}
62sleep 1
63send -- "rm seccomp-test-file\r"
64expect {
65 timeout {puts "TESTING ERROR 7\n";exit}
66 "No such file or directory"
67}
68after 100
69puts "\n"
23 70
71send -- "mkdir seccomp-test-dir\r"
72expect {
73 timeout {puts "TESTING ERROR 8\n";exit}
74 "Operation not permitted"
75}
76after 100
77puts "\n"
78
79send -- "exit\r"
24sleep 1 80sleep 1
25 81
82
83
84
26send -- "rm seccomp-test-file\r" 85send -- "rm seccomp-test-file\r"
27sleep 1 86sleep 1
28puts "all done\n" 87puts "all done\n"