@@ -234,6 +234,14 @@ func TestSetupSeccomp(t *testing.T) {
234
234
Names : []string {"mknod" },
235
235
Action : "SCMP_ACT_NOTIFY" ,
236
236
},
237
+ {
238
+ Names : []string {"rmdir" },
239
+ Action : "SCMP_ACT_KILL_THREAD" ,
240
+ },
241
+ {
242
+ Names : []string {"mkdir" },
243
+ Action : "SCMP_ACT_KILL_PROCESS" ,
244
+ },
237
245
},
238
246
}
239
247
seccomp , err := SetupSeccomp (conf )
@@ -263,9 +271,8 @@ func TestSetupSeccomp(t *testing.T) {
263
271
264
272
calls := seccomp .Syscalls
265
273
266
- callsLength := len (calls )
267
- if callsLength != 8 {
268
- t .Errorf ("Expected 8 syscalls, got :%d" , callsLength )
274
+ if len (calls ) != len (conf .Syscalls ) {
275
+ t .Error ("Mismatched number of syscalls" )
269
276
}
270
277
271
278
for _ , call := range calls {
@@ -317,6 +324,14 @@ func TestSetupSeccomp(t *testing.T) {
317
324
if call .Action != configs .Notify {
318
325
t .Errorf ("Wrong conversion for the %s syscall action" , call .Name )
319
326
}
327
+ case "rmdir" :
328
+ if call .Action != configs .KillThread {
329
+ t .Errorf ("Wrong conversion for the %s syscall action" , call .Name )
330
+ }
331
+ case "mkdir" :
332
+ if call .Action != configs .KillProcess {
333
+ t .Errorf ("Wrong conversion for the %s syscall action" , call .Name )
334
+ }
320
335
default :
321
336
t .Errorf ("Unexpected syscall %s found" , call .Name )
322
337
}
0 commit comments