From a03ccfda795f2ba711b80f69cb06869f2b63121b Mon Sep 17 00:00:00 2001 From: Mark Stemm Date: Thu, 7 Oct 2021 17:00:23 -0700 Subject: [PATCH] Update tests to reflect skipping deprecated events Events with EF_OLD_VERSION/EF_UNUSED are skipped by libsinsp, so skip them here too. Signed-off-by: Mark Stemm --- userspace/libsinsp/test/evttype_filter.ut.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/userspace/libsinsp/test/evttype_filter.ut.cpp b/userspace/libsinsp/test/evttype_filter.ut.cpp index 7b9027490d..45fe323ae8 100644 --- a/userspace/libsinsp/test/evttype_filter.ut.cpp +++ b/userspace/libsinsp/test/evttype_filter.ut.cpp @@ -19,6 +19,8 @@ limitations under the License. #include #include +extern sinsp_evttables g_infotables; + std::stringstream & operator<<(std::stringstream &out, set s) { out << "[ "; @@ -41,6 +43,13 @@ class evttype_filter_test : public testing::Test { for(uint32_t i = 2; i < PPM_EVENT_MAX; i++) { + // Skip "old" event versions that have been replaced + // by newer event versions, or events that are unused. + if(g_infotables.m_event_info[i].flags & (EF_OLD_VERSION | EF_UNUSED)) + { + continue; + } + all_events.insert(i); if(openat_only.find(i) == openat_only.end()) @@ -102,7 +111,6 @@ class evttype_filter_test : public testing::Test } std::set openat_only{ - PPME_SYSCALL_OPENAT_E, PPME_SYSCALL_OPENAT_X, PPME_SYSCALL_OPENAT_2_E, PPME_SYSCALL_OPENAT_2_X }; @@ -111,7 +119,6 @@ class evttype_filter_test : public testing::Test }; std::set openat_close{ - PPME_SYSCALL_OPENAT_E, PPME_SYSCALL_OPENAT_X, PPME_SYSCALL_OPENAT_2_E, PPME_SYSCALL_OPENAT_2_X, PPME_SYSCALL_CLOSE_E, PPME_SYSCALL_CLOSE_X };