Skip to content

Commit

Permalink
chore(test/libsinsp_e2e): enlarge drivers' buffer size to avoid event…
Browse files Browse the repository at this point in the history
… losses.

Signed-off-by: Federico Di Pierro <[email protected]>
  • Loading branch information
FedeDP authored and poiana committed Oct 7, 2024
1 parent 132c93f commit c8e5618
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/libsinsp_e2e/event_capture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ limitations under the License.

std::string event_capture::s_engine_string = KMOD_ENGINE;
std::string event_capture::s_engine_path;
unsigned long event_capture::s_buffer_dim = DEFAULT_DRIVER_BUFFER_BYTES_DIM;
unsigned long event_capture::s_buffer_dim = DEFAULT_DRIVER_BUFFER_BYTES_DIM * 4;

event_capture::event_capture(captured_event_callback_t captured_event_callback,
before_capture_t before_open,
Expand Down
12 changes: 8 additions & 4 deletions test/libsinsp_e2e/unix_client_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ TEST_F(sys_call_test, unix_client_server) {
ends_with(ti->m_args[0], "unix_client_server.py");
}
}

return false;
};

Expand All @@ -120,8 +119,6 @@ TEST_F(sys_call_test, unix_client_server) {
captured_event_callback_t callback = [&](const callback_param& param) {
sinsp_evt* evt = param.m_evt;

// std::cout << evt->get_name() << std::endl;

if(evt->get_type() == PPME_SOCKET_CONNECT_X) {
std::string tuple = evt->get_param_value_str("tuple");
std::string addrs = tuple.substr(0, tuple.find(" "));
Expand Down Expand Up @@ -251,7 +248,14 @@ TEST_F(sys_call_test, unix_client_server) {
//
// OUTPUT VALDATION
//
ASSERT_NO_FATAL_FAILURE({ event_capture::run(test, callback, filter); });
ASSERT_NO_FATAL_FAILURE({
event_capture::run(test,
callback,
filter,
event_capture::do_nothing,
event_capture::do_nothing,
libsinsp::events::sinsp_state_sc_set());
});
EXPECT_FALSE(first_connect_or_accept_seen);
EXPECT_EQ(8, callnum);
}

0 comments on commit c8e5618

Please sign in to comment.