diff options
author | netblue30 <netblue30@yahoo.com> | 2017-08-21 07:44:50 -0400 |
---|---|---|
committer | netblue30 <netblue30@yahoo.com> | 2017-08-21 07:44:50 -0400 |
commit | cad5625f037b06b1d190a6cc88bbeb41a1010dd4 (patch) | |
tree | f644a908960512971358f4a75b4cea618c7f5365 /test/filters | |
parent | Typo for notv (diff) | |
download | firejail-cad5625f037b06b1d190a6cc88bbeb41a1010dd4.tar.gz firejail-cad5625f037b06b1d190a6cc88bbeb41a1010dd4.tar.zst firejail-cad5625f037b06b1d190a6cc88bbeb41a1010dd4.zip |
testing, merges
Diffstat (limited to 'test/filters')
-rw-r--r-- | test/filters/block-secondary.profile | 1 | ||||
-rwxr-xr-x | test/filters/filters.sh | 8 | ||||
-rwxr-xr-x | test/filters/seccomp-debug.exp | 137 |
3 files changed, 139 insertions, 7 deletions
diff --git a/test/filters/block-secondary.profile b/test/filters/block-secondary.profile new file mode 100644 index 000000000..e32056c3d --- /dev/null +++ b/test/filters/block-secondary.profile | |||
@@ -0,0 +1 @@ | |||
seccomp.block-secondary | |||
diff --git a/test/filters/filters.sh b/test/filters/filters.sh index 611580612..3ebb61419 100755 --- a/test/filters/filters.sh +++ b/test/filters/filters.sh | |||
@@ -54,8 +54,12 @@ fi | |||
54 | echo "TESTING: seccomp bad empty (test/filters/seccomp-bad-empty.exp)" | 54 | echo "TESTING: seccomp bad empty (test/filters/seccomp-bad-empty.exp)" |
55 | ./seccomp-bad-empty.exp | 55 | ./seccomp-bad-empty.exp |
56 | 56 | ||
57 | echo "TESTING: seccomp debug (test/filters/seccomp-debug.exp)" | 57 | if [ "$(uname -m)" = "x86_64" ]; then |
58 | ./seccomp-debug.exp | 58 | echo "TESTING: seccomp debug (test/filters/seccomp-debug.exp)" |
59 | ./seccomp-debug.exp | ||
60 | else | ||
61 | echo "TESTING SKIP: protocol, running only on x86_64" | ||
62 | fi | ||
59 | 63 | ||
60 | echo "TESTING: seccomp errno (test/filters/seccomp-errno.exp)" | 64 | echo "TESTING: seccomp errno (test/filters/seccomp-errno.exp)" |
61 | ./seccomp-errno.exp | 65 | ./seccomp-errno.exp |
diff --git a/test/filters/seccomp-debug.exp b/test/filters/seccomp-debug.exp index a95f3bd23..7f03e45e8 100755 --- a/test/filters/seccomp-debug.exp +++ b/test/filters/seccomp-debug.exp | |||
@@ -7,25 +7,152 @@ set timeout 10 | |||
7 | spawn $env(SHELL) | 7 | spawn $env(SHELL) |
8 | match_max 100000 | 8 | match_max 100000 |
9 | 9 | ||
10 | send -- "firejail --seccomp --debug\r" | 10 | send -- "firejail --debug sleep 1; echo done\r" |
11 | expect { | 11 | expect { |
12 | timeout {puts "TESTING ERROR 0\n";exit} | 12 | timeout {puts "TESTING ERROR 0\n";exit} |
13 | "SECCOMP Filter" | 13 | "SECCOMP Filter" |
14 | } | 14 | } |
15 | expect { | 15 | expect { |
16 | timeout {puts "TESTING ERROR 2\n";exit} | 16 | timeout {puts "TESTING ERROR 1\n";exit} |
17 | "BLACKLIST" | 17 | "BLACKLIST" |
18 | } | 18 | } |
19 | expect { | 19 | expect { |
20 | timeout {puts "TESTING ERROR 3\n";exit} | 20 | timeout {puts "TESTING ERROR 2\n";exit} |
21 | "open_by_handle_at" | 21 | "open_by_handle_at" |
22 | } | 22 | } |
23 | expect { | 23 | expect { |
24 | timeout {puts "TESTING ERROR 3\n";exit} | ||
25 | "Child process initialized" | ||
26 | } | ||
27 | expect { | ||
24 | timeout {puts "TESTING ERROR 4\n";exit} | 28 | timeout {puts "TESTING ERROR 4\n";exit} |
29 | "done" | ||
30 | } | ||
31 | after 100 | ||
32 | |||
33 | |||
34 | # amd64 architecture | ||
35 | send -- "firejail --debug sleep 1; echo done\r" | ||
36 | expect { | ||
37 | timeout {puts "TESTING ERROR 5\n";exit} | ||
25 | "Child process initialized" | 38 | "Child process initialized" |
26 | } | 39 | } |
27 | sleep 2 | 40 | expect { |
41 | timeout {puts "TESTING ERROR 6\n";exit} | ||
42 | "Installing /run/firejail/mnt/seccomp seccomp filter" | ||
43 | } | ||
44 | expect { | ||
45 | timeout {puts "TESTING ERROR 7\n";exit} | ||
46 | "Installing /run/firejail/mnt/seccomp.i386 seccomp filter" | ||
47 | } | ||
48 | expect { | ||
49 | timeout {puts "TESTING ERROR 8\n";exit} | ||
50 | "Installing /run/firejail/mnt/seccomp.protocol seccomp filter" | ||
51 | } | ||
52 | expect { | ||
53 | timeout {puts "TESTING ERROR 9\n";exit} | ||
54 | "done" | ||
55 | } | ||
56 | after 100 | ||
28 | 57 | ||
29 | send -- "exit\r" | 58 | # amd64 architecture - ignore seccomp |
59 | send -- "firejail --debug --ignore=seccomp sleep 1; echo done\r" | ||
60 | expect { | ||
61 | timeout {puts "TESTING ERROR 10\n";exit} | ||
62 | "Installing /run/firejail/mnt/seccomp seccomp filter" {puts "TESTING ERROR 11\n";exit} | ||
63 | "Installing /run/firejail/mnt/seccomp.i386 seccomp filter" {puts "TESTING ERROR 12\n";exit} | ||
64 | "Child process initialized" | ||
65 | } | ||
66 | expect { | ||
67 | timeout {puts "TESTING ERROR 13\n";exit} | ||
68 | "Installing /run/firejail/mnt/seccomp seccomp filter" {puts "TESTING ERROR 14\n";exit} | ||
69 | "Installing /run/firejail/mnt/seccomp.i386 seccomp filter" {puts "TESTING ERROR 15\n";exit} | ||
70 | "Installing /run/firejail/mnt/seccomp.protocol seccomp filter" | ||
71 | } | ||
72 | expect { | ||
73 | timeout {puts "TESTING ERROR 16\n";exit} | ||
74 | "done" | ||
75 | } | ||
30 | after 100 | 76 | after 100 |
77 | |||
78 | # amd64 architecture - ignore protocol | ||
79 | send -- "firejail --debug --ignore=protocol sleep 1; echo done\r" | ||
80 | expect { | ||
81 | timeout {puts "TESTING ERROR 17\n";exit} | ||
82 | "Installing /run/firejail/mnt/seccomp.protocol seccomp filter" {puts "TESTING ERROR 18\n";exit} | ||
83 | "Child process initialized" | ||
84 | } | ||
85 | expect { | ||
86 | timeout {puts "TESTING ERROR 19\n";exit} | ||
87 | "Installing /run/firejail/mnt/seccomp.protocol seccomp filter" {puts "TESTING ERROR 20\n";exit} | ||
88 | "Installing /run/firejail/mnt/seccomp seccomp filter" | ||
89 | } | ||
90 | expect { | ||
91 | timeout {puts "TESTING ERROR 21\n";exit} | ||
92 | "Installing /run/firejail/mnt/seccomp.protocol seccomp filter" {puts "TESTING ERROR 22\n";exit} | ||
93 | "Installing /run/firejail/mnt/seccomp.i386 seccomp filter" | ||
94 | } | ||
95 | expect { | ||
96 | timeout {puts "TESTING ERROR 23\n";exit} | ||
97 | "done" | ||
98 | } | ||
99 | after 100 | ||
100 | |||
101 | # memory-deny-write-execute | ||
102 | send -- "firejail --debug --memory-deny-write-execute sleep 1; echo done\r" | ||
103 | expect { | ||
104 | timeout {puts "TESTING ERROR 24\n";exit} | ||
105 | "Child process initialized" | ||
106 | } | ||
107 | expect { | ||
108 | timeout {puts "TESTING ERROR 25\n";exit} | ||
109 | "Installing /run/firejail/mnt/seccomp.protocol seccomp filter" | ||
110 | } | ||
111 | expect { | ||
112 | timeout {puts "TESTING ERROR 26\n";exit} | ||
113 | "done" | ||
114 | } | ||
115 | |||
116 | |||
117 | # amd64 architecture - seccomp.block-secondary | ||
118 | send -- "firejail --debug --seccomp.block-secondary sleep 1; echo done\r" | ||
119 | expect { | ||
120 | timeout {puts "TESTING ERROR 27\n";exit} | ||
121 | "Installing /run/firejail/mnt/seccomp.i386 seccomp filter" {puts "TESTING ERROR 28\n";exit} | ||
122 | "Child process initialized" | ||
123 | } | ||
124 | expect { | ||
125 | timeout {puts "TESTING ERROR 29\n";exit} | ||
126 | "Installing /run/firejail/mnt/seccomp.i386 seccomp filter" {puts "TESTING ERROR 30\n";exit} | ||
127 | "Installing /run/firejail/mnt/seccomp seccomp filter" | ||
128 | } | ||
129 | expect { | ||
130 | timeout {puts "TESTING ERROR 31\n";exit} | ||
131 | "Installing /run/firejail/mnt/seccomp.i386 seccomp filter" {puts "TESTING ERROR 32\n";exit} | ||
132 | "Installing /run/firejail/mnt/seccomp.protocol seccomp filter" | ||
133 | } | ||
134 | expect { | ||
135 | timeout {puts "TESTING ERROR 33\n";exit} | ||
136 | "done" | ||
137 | } | ||
138 | after 100 | ||
139 | |||
140 | # amd64 architecture - seccomp.block-secondary, profile | ||
141 | send -- "firejail --debug --profile=block-secondary.profile sleep 1; echo done\r" | ||
142 | expect { | ||
143 | timeout {puts "TESTING ERROR 33\n";exit} | ||
144 | "Installing /run/firejail/mnt/seccomp.i386 seccomp filter" {puts "TESTING ERROR 34\n";exit} | ||
145 | "Child process initialized" | ||
146 | } | ||
147 | expect { | ||
148 | timeout {puts "TESTING ERROR 35\n";exit} | ||
149 | "Installing /run/firejail/mnt/seccomp.i386 seccomp filter" {puts "TESTING ERROR 35\n";exit} | ||
150 | "Installing /run/firejail/mnt/seccomp seccomp filter" | ||
151 | } | ||
152 | expect { | ||
153 | timeout {puts "TESTING ERROR 37\n";exit} | ||
154 | "done" | ||
155 | } | ||
156 | after 100 | ||
157 | |||
31 | puts "all done\n" | 158 | puts "all done\n" |