google/kafel

Tests depend on system configuration, fail if SIGSYS dumps core

mejedi opened this issue · 1 comments

Tests fail if SIGSYS dumps core. Quick and dirty fix:

--- a/kafel/test/runner/harness.c
+++ b/kafel/test/runner/harness.c
@@ -160,10 +160,10 @@ int test_policy_enforcment(test_func_t test_func, void* data,
       TEST_FAIL("non-zero (%d) exit code", si.si_status);
     }
   }
-  if (should_kill && (si.si_code != CLD_KILLED || si.si_status != SIGSYS)) {
+  if (should_kill && ((si.si_code != CLD_DUMPED && si.si_code != CLD_KILLED) || si.si_status != SIGSYS)) {
     TEST_FAIL("should be killed by seccomp");
   }
-  if (si.si_code == CLD_KILLED) {
+  if (si.si_code == CLD_KILLED || si.si_code == CLD_DUMPED) {
     if (si.si_status == SIGSYS) {
       if (!should_kill) {
         TEST_FAIL("should not be killed by seccomp");

Thanks.
Should be fixed now.