diff options
author | netblue30 <netblue30@yahoo.com> | 2015-09-27 08:00:06 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2015-09-27 08:00:06 -0400 |
commit | 200b205b69f9a6874e55bf76ca876d2c4fcee4ac (patch) | |
tree | cb99a492f5a4da38a4254677d7094a1fece3dc2c /test/seccomp-errno.exp | |
parent | seccomp errno: man page and usage (diff) | |
download | firejail-200b205b69f9a6874e55bf76ca876d2c4fcee4ac.tar.gz firejail-200b205b69f9a6874e55bf76ca876d2c4fcee4ac.tar.zst firejail-200b205b69f9a6874e55bf76ca876d2c4fcee4ac.zip |
seccomp errno testing
Diffstat (limited to 'test/seccomp-errno.exp')
-rwxr-xr-x | test/seccomp-errno.exp | 63 |
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 | |||
16 | sleep 1 | 15 | sleep 1 |
17 | 16 | ||
18 | send -- "firejail --seccomp.enoent=unlinkat --debug rm seccomp-test-file\r" | 17 | send -- "firejail --seccomp.enoent=unlinkat --debug rm seccomp-test-file\r" |
19 | expect { | 18 | expect { |
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 | } |
22 | sleep 1 | ||
23 | |||
24 | send -- "firejail --seccomp.enoent=unlinkat,mkdir\r" | ||
25 | expect { | ||
26 | timeout {puts "TESTING ERROR 2\n";exit} | ||
27 | "Child process initialized" | ||
28 | } | ||
29 | sleep 1 | ||
30 | send -- "rm seccomp-test-file\r" | ||
31 | expect { | ||
32 | timeout {puts "TESTING ERROR 3\n";exit} | ||
33 | "No such file or directory" | ||
34 | } | ||
35 | after 100 | ||
36 | puts "\n" | ||
37 | |||
38 | send -- "mkdir seccomp-test-dir\r" | ||
39 | expect { | ||
40 | timeout {puts "TESTING ERROR 4\n";exit} | ||
41 | "No such file or directory" | ||
42 | } | ||
43 | after 100 | ||
44 | puts "\n" | ||
45 | |||
46 | send -- "exit\r" | ||
47 | sleep 1 | ||
48 | |||
49 | |||
50 | send -- "firejail --seccomp.enoent=unlinkat --seccomp.enoent=mkdir\r" | ||
51 | expect { | ||
52 | timeout {puts "TESTING ERROR 5\n";exit} | ||
53 | "errno enoent already configured" | ||
54 | } | ||
55 | sleep 1 | ||
56 | |||
57 | send -- "firejail --seccomp.enoent=unlinkat --seccomp.eperm=mkdir\r" | ||
58 | expect { | ||
59 | timeout {puts "TESTING ERROR 6\n";exit} | ||
60 | "Child process initialized" | ||
61 | } | ||
62 | sleep 1 | ||
63 | send -- "rm seccomp-test-file\r" | ||
64 | expect { | ||
65 | timeout {puts "TESTING ERROR 7\n";exit} | ||
66 | "No such file or directory" | ||
67 | } | ||
68 | after 100 | ||
69 | puts "\n" | ||
23 | 70 | ||
71 | send -- "mkdir seccomp-test-dir\r" | ||
72 | expect { | ||
73 | timeout {puts "TESTING ERROR 8\n";exit} | ||
74 | "Operation not permitted" | ||
75 | } | ||
76 | after 100 | ||
77 | puts "\n" | ||
78 | |||
79 | send -- "exit\r" | ||
24 | sleep 1 | 80 | sleep 1 |
25 | 81 | ||
82 | |||
83 | |||
84 | |||
26 | send -- "rm seccomp-test-file\r" | 85 | send -- "rm seccomp-test-file\r" |
27 | sleep 1 | 86 | sleep 1 |
28 | puts "all done\n" | 87 | puts "all done\n" |