From 4a717c966f4dc7e4edaa7e87e477d558fa9150cd Mon Sep 17 00:00:00 2001 From: chantra Date: Thu, 11 Aug 2022 16:10:21 +0000 Subject: [PATCH] [test][usdt_probes][bionic] kill child manually bionic has util-linux 2.31, `unshare` added support for `--kill-child` in 2.32. This change remove the use of the argument `--kill-child` and instead kills the child process manually before returning. While this is not going to take care of all corner cases, it is probably more than enough for when the test is succeeding. --- tests/cc/test_usdt_probes.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/cc/test_usdt_probes.cc b/tests/cc/test_usdt_probes.cc index 4992cef4520e..b9711105b3b5 100644 --- a/tests/cc/test_usdt_probes.cc +++ b/tests/cc/test_usdt_probes.cc @@ -376,7 +376,7 @@ TEST_CASE("test probing running Ruby process in namespaces", SECTION("in separate mount namespace and separate PID namespace") { static char _unshare[] = "unshare"; - const char *const argv[8] = {_unshare, "--fork", "--kill-child", + const char *const argv[8] = {_unshare, "--fork", "--mount", "--pid", "--mount-proc", "ruby", NULL}; @@ -404,6 +404,7 @@ TEST_CASE("test probing running Ruby process in namespaces", std::string module = pid_root + "usr/local/bin/ruby"; REQUIRE(bcc_resolve_symname(module.c_str(), "rb_gc_mark", 0x0, ruby_pid, nullptr, &sym) == 0); REQUIRE(std::string(sym.module).find(pid_root, 1) == std::string::npos); + kill(ruby_pid, SIGKILL); bcc_procutils_free(sym.module); } }