From 371271461b009cb81ad11ff5470dfc68166dca09 Mon Sep 17 00:00:00 2001 From: Roberto Scolaro Date: Tue, 8 Oct 2024 07:34:56 +0000 Subject: [PATCH] fix(libsinsp_e2e): filter using tid Signed-off-by: Roberto Scolaro --- test/libsinsp_e2e/sys_call_test.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/libsinsp_e2e/sys_call_test.cpp b/test/libsinsp_e2e/sys_call_test.cpp index 5a73a6329c..1e3522e555 100644 --- a/test/libsinsp_e2e/sys_call_test.cpp +++ b/test/libsinsp_e2e/sys_call_test.cpp @@ -1357,13 +1357,15 @@ TEST_F(sys_call_test, getsetresuid_and_gid) { ret = system("groupdel testsetresgid"); usleep(200); + const pid_t self = getpid(); + // // FILTER // event_filter_t filter = [&](sinsp_evt* evt) { auto type = evt->get_type(); auto tinfo = evt->get_thread_info(true); - return tinfo->m_comm != "sudo" && + return tinfo->m_comm != "sudo" && tinfo->m_pid == self && (type == PPME_USER_ADDED_E || type == PPME_USER_ADDED_X || type == PPME_GROUP_ADDED_E || type == PPME_GROUP_ADDED_X || type == PPME_SYSCALL_GETRESUID_E || type == PPME_SYSCALL_GETRESUID_X ||