Skip to content

Commit

Permalink
fix(tests): fix minor unshare_ test issues
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo committed Feb 7, 2024
1 parent 7289f72 commit 17faa80
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/libsinsp_e2e/sys_call_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ TEST_F(sys_call_test, unshare_)
event_filter_t filter = [&](sinsp_evt* evt)
{
auto tinfo = evt->get_thread_info(true);
return tinfo->get_comm() == "tests" && (evt->get_type() == PPME_SYSCALL_UNSHARE_E ||
return tinfo->get_comm() == "libsinsp_e2e_te" && (evt->get_type() == PPME_SYSCALL_UNSHARE_E ||
evt->get_type() == PPME_SYSCALL_UNSHARE_X);
};
run_callback_t test = [&](sinsp* inspector)
Expand All @@ -1211,7 +1211,8 @@ TEST_F(sys_call_test, unshare_)
if (child == 0)
{
unshare(CLONE_NEWUTS);
exit(0);
// _exit prevents asan from complaining for a false positive memory leak.
_exit(0);
}
waitpid(child, NULL, 0);
};
Expand Down

0 comments on commit 17faa80

Please sign in to comment.