Skip to content

Commit

Permalink
fix(tests): invoke helper scripts with absolute paths
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo committed Feb 16, 2024
1 parent 15ab1cf commit 0009a01
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 5 additions & 1 deletion test/libsinsp_e2e/libsinsp_test_var.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,8 @@ limitations under the License.
// Absolute path to the bpf probe .o file
#define LIBSINSP_TEST_BPF_PROBE_PATH "${CMAKE_BINARY_DIR}/driver/bpf/probe.o"

#define LIBSINSP_TEST_CAPTURES_PATH "${CMAKE_BINARY_DIR}/test/libsinsp_e2e/captures"
#define LIBSINSP_TEST_CAPTURES_PATH "${CMAKE_BINARY_DIR}/test/libsinsp_e2e/captures/"

#define LIBSINSP_TEST_RESOURCES_PATH "${CMAKE_BINARY_DIR}/test/libsinsp_e2e/resources/"

#define LIBSINSP_TEST_PATH "${CMAKE_BINARY_DIR}/test/libsinsp_e2e/"
6 changes: 4 additions & 2 deletions test/libsinsp_e2e/sys_call_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,9 @@ TEST_F(sys_call_test32, execve_ia32_emulation)

run_callback_t test = [&](sinsp* inspector)
{
auto ret = system("./resources/execve32 ./resources/execve ./resources/execve32");
auto ret = system(LIBSINSP_TEST_RESOURCES_PATH "execve32 "
LIBSINSP_TEST_RESOURCES_PATH "execve "
LIBSINSP_TEST_RESOURCES_PATH "execve32");
EXPECT_EQ(0, ret);
};

Expand Down Expand Up @@ -1074,7 +1076,7 @@ TEST_F(sys_call_test32, quotactl_ko)

run_callback_t test = [&](sinsp* inspector)
{
subprocess handle("./test_helper_32", {"quotactl_ko"});
subprocess handle(LIBSINSP_TEST_PATH "/test_helper_32", {"quotactl_ko"});
handle.wait();
};

Expand Down

0 comments on commit 0009a01

Please sign in to comment.