From 43bb44bd4fe4ea3194c106d7977bf9bbe20f4060 Mon Sep 17 00:00:00 2001 From: Roberto Scolaro Date: Tue, 16 Jul 2024 13:28:45 +0000 Subject: [PATCH] chore: move PPM_MAX_PATH_SIZE macro to tests Signed-off-by: Roberto Scolaro --- driver/ppm_events_public.h | 1 - test/drivers/event_class/event_class.h | 1 + test/libsinsp_e2e/sys_call_test.cpp | 3 ++- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/driver/ppm_events_public.h b/driver/ppm_events_public.h index 56bb879205e..0957c77df5f 100644 --- a/driver/ppm_events_public.h +++ b/driver/ppm_events_public.h @@ -38,7 +38,6 @@ or GPL2.txt for full copies of the license. * Limits */ #define PPM_MAX_EVENT_PARAMS (1 << 5) /* Max number of parameters an event can have */ -#define PPM_MAX_PATH_SIZE 1024 /* Max size that an event parameter can have in the circular buffer, in bytes */ #define PPM_MAX_NAME_LEN 32 /* diff --git a/test/drivers/event_class/event_class.h b/test/drivers/event_class/event_class.h index 360f65620bb..3f5d8b79389 100644 --- a/test/drivers/event_class/event_class.h +++ b/test/drivers/event_class/event_class.h @@ -16,6 +16,7 @@ #define CURRENT_PID -1 #define CURRENT_EVENT_TYPE -1 +#define PPM_MAX_PATH_SIZE 1024 /* Max size that an event parameter can have in the circular buffer, in bytes */ extern "C" { diff --git a/test/libsinsp_e2e/sys_call_test.cpp b/test/libsinsp_e2e/sys_call_test.cpp index 014982e880d..1bc1c4c1026 100644 --- a/test/libsinsp_e2e/sys_call_test.cpp +++ b/test/libsinsp_e2e/sys_call_test.cpp @@ -2515,7 +2515,8 @@ TEST_F(sys_call_test, fd_name_max_path) { int callnum = 0; std::string pathname("/"); - pathname.insert(1, PPM_MAX_PATH_SIZE - 3, 'A'); + // Using only 1022 chars otherwise the path will be "/PATH_TOO_LONG". + pathname.insert(1, 1021, 'A'); event_filter_t filter = [&](sinsp_evt* evt) {