Skip to content

Commit

Permalink
Update tests to reflect skipping deprecated events
Browse files Browse the repository at this point in the history
Events with EF_OLD_VERSION/EF_UNUSED are skipped by libsinsp, so skip
them here too.

Signed-off-by: Mark Stemm <mark.stemm@gmail.com>
  • Loading branch information
mstemm authored and poiana committed Oct 11, 2021
1 parent 0a34d54 commit a03ccfd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions userspace/libsinsp/test/evttype_filter.ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ limitations under the License.
#include <sinsp.h>
#include <filter.h>

extern sinsp_evttables g_infotables;

std::stringstream & operator<<(std::stringstream &out, set<uint16_t> s)
{
out << "[ ";
Expand All @@ -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())
Expand Down Expand Up @@ -102,7 +111,6 @@ class evttype_filter_test : public testing::Test
}

std::set<uint16_t> openat_only{
PPME_SYSCALL_OPENAT_E, PPME_SYSCALL_OPENAT_X,
PPME_SYSCALL_OPENAT_2_E, PPME_SYSCALL_OPENAT_2_X
};

Expand All @@ -111,7 +119,6 @@ class evttype_filter_test : public testing::Test
};

std::set<uint16_t> 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
};
Expand Down

0 comments on commit a03ccfd

Please sign in to comment.