From d816067e192449b57c7c3ad3b48a905a51f151fb Mon Sep 17 00:00:00 2001 From: Roberto Scolaro Date: Wed, 10 Apr 2024 10:14:43 +0000 Subject: [PATCH] chore(libsinsp_e2e): added log on failure Signed-off-by: Roberto Scolaro --- test/libsinsp_e2e/forking.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/libsinsp_e2e/forking.cpp b/test/libsinsp_e2e/forking.cpp index 5438db4bbf5..5d6473fe89a 100644 --- a/test/libsinsp_e2e/forking.cpp +++ b/test/libsinsp_e2e/forking.cpp @@ -346,6 +346,7 @@ TEST_F(sys_call_test, forking_clone_fs) char bcwd[1024]; int prfd; int ptid; // parent tid + pid_t clone_tid; int child_tid; int parent_res; int flags = CLONE_FILES | CLONE_FS | CLONE_VM | CLONE_PARENT_SETTID; @@ -394,7 +395,7 @@ TEST_F(sys_call_test, forking_clone_fs) /* Create child; child commences execution in childFunc() */ - pid_t clone_tid = clone(clone_callback_1, stackTop, flags, &cp, + clone_tid = clone(clone_callback_1, stackTop, flags, &cp, &child_tid); if (clone_tid == -1) FAIL(); @@ -477,7 +478,12 @@ TEST_F(sys_call_test, forking_clone_fs) sinsp_fdinfo* fdi = ti->get_fd(prfd); if(fdi && fdi->tostring_clean().find(FILENAME) != std::string::npos) { - EXPECT_EQ(parent_res, res); + EXPECT_EQ(parent_res, res) << "filename: " + << fdi->tostring_clean() << std::endl + << "res: " << res << std::endl + << "parent tid: " << ptid << std::endl + << "child tid: " << child_tid << std::endl + << "clone tid: " << clone_tid << std::endl; } } else if (ti->m_tid == child_tid)