diff --git a/tools/tests/test_native_hook_handoff.py b/tools/tests/test_native_hook_handoff.py index 0859da33d1..93ae6969db 100644 --- a/tools/tests/test_native_hook_handoff.py +++ b/tools/tests/test_native_hook_handoff.py @@ -798,8 +798,11 @@ class NativeHookHandoffTest(unittest.TestCase): stub.write_bytes(b"\x7fELF") stub.chmod(0o755) result, requests, out = self.run_parent("spawn", "6", "/bin/stub", handoff="stub") + self.assertEqual(0, out.returncode, out.stderr) self.assertEqual([], requests) - self.assertNotEqual("0", result.get("spawned"), out.stdout) + self.assertEqual(str(errno.ENOEXEC), result.get("spawned"), out.stdout) + self.assertNotIn("exit", result, out.stdout) + self.assertNotIn("signal", result, out.stdout) def test_wnothread_child_goes_to_the_first_live_thread(self): # The forking thread and the main one both ended. Which thread the kernel gives the child to @@ -824,6 +827,8 @@ class NativeHookHandoffTest(unittest.TestCase): self.assertEqual("7", result.get("exit"), out.stdout) def test_a_late_record_of_a_spawned_child_keeps_a_handoffs_owner(self): + if self.child_status != "3": + self.skipTest("a child here cannot exec an aarch64 program (no binfmt_misc), so nothing can be spawned") # the pid has to be given again, which only a pid namespace of the test's own allows if not os.environ.get("DDH_TEST_PIDNS"): unshare = shutil.which("unshare") @@ -838,8 +843,6 @@ class NativeHookHandoffTest(unittest.TestCase): self.assertEqual(0, out.returncode, out.stderr) self.assertNotIn("skipped", out.stderr, out.stderr) return - if self.child_status != "3": - self.skipTest("a child here cannot exec an aarch64 program (no binfmt_misc), so nothing can be spawned") result, requests, out = self.run_parent("laterecord", "sleep") self.assertEqual("1", result.get("reused"), out.stdout + out.stderr) self.assertEqual("0", result.get("spawned"), out.stdout)