From c5a6a68606b05320cf2d14fa46d40f98ebd861e6 Mon Sep 17 00:00:00 2001 From: Andrea Terzolo Date: Wed, 28 Aug 2024 17:55:06 +0200 Subject: [PATCH] cleanup(tests): improve network methods Signed-off-by: Andrea Terzolo --- test/drivers/event_class/event_class.cpp | 52 ++++++++++++----- test/drivers/event_class/event_class.h | 20 +++++-- test/drivers/event_class/network_utils.h | 32 ++++++---- .../syscall_enter_suite/sendmsg_e.cpp | 9 +-- .../syscall_enter_suite/sendto_e.cpp | 9 +-- .../test_suites/syscall_exit_suite/read_x.cpp | 24 ++++---- .../syscall_exit_suite/recvfrom_x.cpp | 55 +++++++++--------- .../syscall_exit_suite/recvmsg_x.cpp | 58 +++++++++---------- .../syscall_exit_suite/sendmsg_x.cpp | 26 +++------ .../syscall_exit_suite/sendto_x.cpp | 26 +++------ .../syscall_exit_suite/write_x.cpp | 6 +- 11 files changed, 164 insertions(+), 153 deletions(-) diff --git a/test/drivers/event_class/event_class.cpp b/test/drivers/event_class/event_class.cpp index 5cf7194945..f251d894f7 100644 --- a/test/drivers/event_class/event_class.cpp +++ b/test/drivers/event_class/event_class.cpp @@ -406,7 +406,7 @@ void event_test::connect_ipv4_client_to_server(int32_t* client_socket, sockaddr_ assert_syscall_state(SYSCALL_SUCCESS, "connect (client)", syscall(__NR_connect, *client_socket, (sockaddr*)server_sockaddr, sizeof(*server_sockaddr)), NOT_EQUAL, -1); } -void event_test::client_to_server(send_data send_d, receive_data receive_d, protocol_L3 proto_L3, protocol_L4 proto_L4) +void event_test::client_to_server(send_data send_d, recv_data receive_d, network_config net_config) { int32_t client_socket_fd = 0; int32_t server_socket_fd = 0; @@ -421,18 +421,18 @@ void event_test::client_to_server(send_data send_d, receive_data receive_d, prot // Setup Connection ////////////////////// - switch(proto_L3) + switch(net_config.proto_L3) { case protocol_L3::IPv4: - if(proto_L4 == protocol_L4::TCP) + if(net_config.proto_L4 == protocol_L4::TCP) { this->connect_ipv4_client_to_server(&client_socket_fd, &client_addr, &server_socket_fd, - &server_addr); + &server_addr, net_config.client_port, net_config.server_port); } else { this->connect_ipv4_udp_client_to_server(&client_socket_fd, &client_addr, &server_socket_fd, - &server_addr); + &server_addr, net_config.client_port, net_config.server_port); } // for the `recv*` syscalls we will use the memory of the server sockaddr but this will be overwritten // by the kernel so it shouldn't be an issue. @@ -440,15 +440,15 @@ void event_test::client_to_server(send_data send_d, receive_data receive_d, prot addrlen = sizeof(server_addr); break; case protocol_L3::IPv6: - if(proto_L4 == protocol_L4::TCP) + if(net_config.proto_L4 == protocol_L4::TCP) { this->connect_ipv6_client_to_server(&client_socket_fd, &client_addr6, &server_socket_fd, - &server_addr6); + &server_addr6, net_config.client_port, net_config.server_port); } else { this->connect_ipv6_udp_client_to_server(&client_socket_fd, &client_addr6, &server_socket_fd, - &server_addr6); + &server_addr6, net_config.client_port, net_config.server_port); } addr = (sockaddr*)&server_addr6; addrlen = sizeof(server_addr6); @@ -557,7 +557,7 @@ void event_test::client_to_server(send_data send_d, receive_data receive_d, prot // Receive message ////////////////////// int receive_socket_fd = server_socket_fd; - if(proto_L4 == protocol_L4::TCP) + if(net_config.proto_L4 == protocol_L4::TCP) { // In case of TCP we need to accept the connection. receive_socket_fd = syscall(__NR_accept4, server_socket_fd, NULL, NULL, 0); @@ -648,7 +648,7 @@ void event_test::client_to_server(send_data send_d, receive_data receive_d, prot ////////////////////// // Cleaning phase ////////////////////// - if(proto_L4 == protocol_L4::TCP) + if(net_config.proto_L4 == protocol_L4::TCP) { syscall(__NR_shutdown, receive_socket_fd, 2); syscall(__NR_close, receive_socket_fd); @@ -659,6 +659,26 @@ void event_test::client_to_server(send_data send_d, receive_data receive_d, prot syscall(__NR_close, client_socket_fd); } +void event_test::client_to_server_ipv4_tcp(send_data send_d, recv_data receive_d, int32_t client_port, int32_t server_port) +{ + this->client_to_server(send_d, receive_d, network_config{.proto_L3 = protocol_L3::IPv4, .proto_L4 = protocol_L4::TCP, .client_port = client_port, .server_port = server_port}); +} + +void event_test::client_to_server_ipv4_udp(send_data send_d, recv_data receive_d, int32_t client_port, int32_t server_port) +{ + this->client_to_server(send_d, receive_d, network_config{.proto_L3 = protocol_L3::IPv4, .proto_L4 = protocol_L4::UDP, .client_port = client_port, .server_port = server_port}); +} + +void event_test::client_to_server_ipv6_tcp(send_data send_d, recv_data receive_d, int32_t client_port, int32_t server_port) +{ + this->client_to_server(send_d, receive_d, network_config{.proto_L3 = protocol_L3::IPv6, .proto_L4 = protocol_L4::TCP, .client_port = client_port, .server_port = server_port}); +} + +void event_test::client_to_server_ipv6_udp(send_data send_d, recv_data receive_d, int32_t client_port, int32_t server_port) +{ + this->client_to_server(send_d, receive_d, network_config{.proto_L3 = protocol_L3::IPv6, .proto_L4 = protocol_L4::UDP, .client_port = client_port, .server_port = server_port}); +} + void event_test::connect_ipv4_udp_client_to_server(int32_t* client_socket, sockaddr_in* client_sockaddr, int32_t* server_socket, sockaddr_in* server_sockaddr, int32_t port_client, int32_t port_server) { /* Create the server socket. */ @@ -685,7 +705,7 @@ void event_test::connect_ipv4_udp_client_to_server(int32_t* client_socket, socka assert_syscall_state(SYSCALL_SUCCESS, "bind (client)", syscall(__NR_bind, *client_socket, (sockaddr*)client_sockaddr, sizeof(*client_sockaddr)), NOT_EQUAL, -1); } -void event_test::connect_ipv6_client_to_server(int32_t* client_socket, sockaddr_in6* client_sockaddr, int32_t* server_socket, sockaddr_in6* server_sockaddr) +void event_test::connect_ipv6_client_to_server(int32_t* client_socket, sockaddr_in6* client_sockaddr, int32_t* server_socket, sockaddr_in6* server_sockaddr, int32_t port_client, int32_t port_server) { /* Create the server socket. */ *server_socket = syscall(__NR_socket, AF_INET6, SOCK_STREAM | SOCK_NONBLOCK, 0); @@ -693,7 +713,7 @@ void event_test::connect_ipv6_client_to_server(int32_t* client_socket, sockaddr_ server_reuse_address_port(*server_socket); memset(server_sockaddr, 0, sizeof(*server_sockaddr)); - server_fill_sockaddr_in6(server_sockaddr); + server_fill_sockaddr_in6(server_sockaddr, port_server); /* Now we bind the server socket with the server address. */ assert_syscall_state(SYSCALL_SUCCESS, "bind (server)", syscall(__NR_bind, *server_socket, (sockaddr*)server_sockaddr, sizeof(*server_sockaddr)), NOT_EQUAL, -1); @@ -706,14 +726,14 @@ void event_test::connect_ipv6_client_to_server(int32_t* client_socket, sockaddr_ client_reuse_address_port(*client_socket); memset(client_sockaddr, 0, sizeof(*client_sockaddr)); - client_fill_sockaddr_in6(client_sockaddr); + client_fill_sockaddr_in6(client_sockaddr, port_client); /* We need to bind the client socket with an address otherwise we cannot assert against it. */ assert_syscall_state(SYSCALL_SUCCESS, "bind (client)", syscall(__NR_bind, *client_socket, (sockaddr*)client_sockaddr, sizeof(*client_sockaddr)), NOT_EQUAL, -1); assert_syscall_state(SYSCALL_SUCCESS, "connect (client)", syscall(__NR_connect, *client_socket, (sockaddr*)server_sockaddr, sizeof(*server_sockaddr)), NOT_EQUAL, -1); } -void event_test::connect_ipv6_udp_client_to_server(int32_t* client_socket, sockaddr_in6* client_sockaddr, int32_t* server_socket, sockaddr_in6* server_sockaddr) +void event_test::connect_ipv6_udp_client_to_server(int32_t* client_socket, sockaddr_in6* client_sockaddr, int32_t* server_socket, sockaddr_in6* server_sockaddr, int32_t port_client, int32_t port_server) { /* Create the server socket. */ *server_socket = syscall(__NR_socket, AF_INET6, SOCK_DGRAM, 0); @@ -721,7 +741,7 @@ void event_test::connect_ipv6_udp_client_to_server(int32_t* client_socket, socka server_reuse_address_port(*server_socket); memset(server_sockaddr, 0, sizeof(*server_sockaddr)); - server_fill_sockaddr_in6(server_sockaddr); + server_fill_sockaddr_in6(server_sockaddr, port_server); /* Now we bind the server socket with the server address. */ assert_syscall_state(SYSCALL_SUCCESS, "bind (server)", syscall(__NR_bind, *server_socket, (sockaddr*)server_sockaddr, sizeof(*server_sockaddr)), NOT_EQUAL, -1); @@ -733,7 +753,7 @@ void event_test::connect_ipv6_udp_client_to_server(int32_t* client_socket, socka client_reuse_address_port(*client_socket); memset(client_sockaddr, 0, sizeof(*client_sockaddr)); - client_fill_sockaddr_in6(client_sockaddr); + client_fill_sockaddr_in6(client_sockaddr, port_client); /* We need to bind the client socket with an address otherwise we cannot assert against it. */ assert_syscall_state(SYSCALL_SUCCESS, "bind (client)", syscall(__NR_bind, *client_socket, (sockaddr*)client_sockaddr, sizeof(*client_sockaddr)), NOT_EQUAL, -1); diff --git a/test/drivers/event_class/event_class.h b/test/drivers/event_class/event_class.h index 30126ac7d4..ad6678f6f3 100644 --- a/test/drivers/event_class/event_class.h +++ b/test/drivers/event_class/event_class.h @@ -43,7 +43,7 @@ struct send_data { bool null_sockaddr; }; -struct receive_data { +struct recv_data { int syscall_num; bool null_sockaddr; bool null_receiver_buffer; @@ -62,6 +62,14 @@ enum protocol_L3 IPv6 = 1, }; +struct network_config +{ + protocol_L3 proto_L3; + protocol_L4 proto_L4; + int32_t client_port; + int32_t server_port; +}; + /* Assertion operators */ enum assertion_operators { @@ -355,12 +363,16 @@ class event_test void connect_ipv4_udp_client_to_server(int32_t* client_socket, struct sockaddr_in* client_sockaddr, int32_t* server_socket, struct sockaddr_in* server_sockaddr, int32_t client_port = IPV4_PORT_CLIENT, int32_t server_port = IPV4_PORT_SERVER); // todo!: we should rename it into `connect_ipv6_client_to_server` - void connect_ipv6_client_to_server(int32_t* client_socket, struct sockaddr_in6* client_sockaddr, int32_t* server_socket, struct sockaddr_in6* server_sockaddr); - void connect_ipv6_udp_client_to_server(int32_t* client_socket, sockaddr_in6* client_sockaddr, int32_t* server_socket, sockaddr_in6* server_sockaddr); + void connect_ipv6_client_to_server(int32_t* client_socket, struct sockaddr_in6* client_sockaddr, int32_t* server_socket, struct sockaddr_in6* server_sockaddr, int32_t client_port = IPV6_PORT_CLIENT, int32_t server_port = IPV6_PORT_SERVER); + void connect_ipv6_udp_client_to_server(int32_t* client_socket, sockaddr_in6* client_sockaddr, int32_t* server_socket, sockaddr_in6* server_sockaddr, int32_t client_port = IPV6_PORT_CLIENT, int32_t server_port = IPV6_PORT_SERVER); void connect_unix_client_to_server(int32_t* client_socket, struct sockaddr_un* client_sockaddr, int32_t* server_socket, struct sockaddr_un* server_sockaddr); - void client_to_server(send_data send_d, receive_data receive_d, protocol_L3 proto_L3, protocol_L4 proto_L4); + void client_to_server(send_data send_d, recv_data receive_d, network_config net_config); + void client_to_server_ipv4_tcp(send_data send_d, recv_data receive_d = {.skip_recv_phase = true}, int32_t client_port = IP_PORT_CLIENT, int32_t server_port = IP_PORT_SERVER); + void client_to_server_ipv4_udp(send_data send_d, recv_data receive_d = {.skip_recv_phase = true}, int32_t client_port = IP_PORT_CLIENT, int32_t server_port = IP_PORT_SERVER); + void client_to_server_ipv6_tcp(send_data send_d, recv_data receive_d = {.skip_recv_phase = true}, int32_t client_port = IP_PORT_CLIENT, int32_t server_port = IP_PORT_SERVER); + void client_to_server_ipv6_udp(send_data send_d, recv_data receive_d = {.skip_recv_phase = true}, int32_t client_port = IP_PORT_CLIENT, int32_t server_port = IP_PORT_SERVER); ///////////////////////////////// // GENERIC EVENT ASSERTIONS diff --git a/test/drivers/event_class/network_utils.h b/test/drivers/event_class/network_utils.h index fae3aa01cf..cc848daded 100644 --- a/test/drivers/event_class/network_utils.h +++ b/test/drivers/event_class/network_utils.h @@ -16,22 +16,34 @@ /* Server queue length. */ #define QUEUE_LENGTH 2 +/* IP ports + * todo!: The distinction between ipv4 and ipv6 ports is not necessary. + * at the moment we keep them just too avoid to touch many files. + */ +#define IP_PORT_DNS 53 +#define IP_PORT_EMPTY 0 +#define IP_PORT_EMPTY_STRING "0" +#define IP_PORT_CLIENT 51789 +#define IP_PORT_CLIENT_STRING "51789" +#define IP_PORT_SERVER 52889 +#define IP_PORT_SERVER_STRING "52889" + /*=============================== IPV4 ===========================*/ /* Empty endpoint */ #define IPV4_EMPTY "0.0.0.0" -#define IPV4_PORT_EMPTY 0 -#define IPV4_PORT_EMPTY_STRING "0" +#define IPV4_PORT_EMPTY IP_PORT_EMPTY +#define IPV4_PORT_EMPTY_STRING IP_PORT_EMPTY_STRING /* IPv4 Client */ #define IPV4_CLIENT "127.0.21.34" -#define IPV4_PORT_CLIENT 51789 -#define IPV4_PORT_CLIENT_STRING "51789" +#define IPV4_PORT_CLIENT IP_PORT_CLIENT +#define IPV4_PORT_CLIENT_STRING IP_PORT_CLIENT_STRING /* IPv4 Server */ #define IPV4_SERVER "127.59.21.35" -#define IPV4_PORT_SERVER 52889 -#define IPV4_PORT_SERVER_STRING "52889" +#define IPV4_PORT_SERVER IP_PORT_SERVER +#define IPV4_PORT_SERVER_STRING IP_PORT_SERVER_STRING /*=============================== IPV4 ===========================*/ @@ -39,13 +51,13 @@ /* IPv6 Client */ #define IPV6_CLIENT "::ffff:127.0.0.4" -#define IPV6_PORT_CLIENT 51790 -#define IPV6_PORT_CLIENT_STRING "51790" +#define IPV6_PORT_CLIENT IP_PORT_CLIENT +#define IPV6_PORT_CLIENT_STRING IP_PORT_CLIENT_STRING /* IPv6 Server */ #define IPV6_SERVER "::ffff:127.0.0.5" -#define IPV6_PORT_SERVER 52890 -#define IPV6_PORT_SERVER_STRING "52890" +#define IPV6_PORT_SERVER IP_PORT_SERVER +#define IPV6_PORT_SERVER_STRING IP_PORT_SERVER_STRING /*=============================== IPV6 ===========================*/ diff --git a/test/drivers/test_suites/syscall_enter_suite/sendmsg_e.cpp b/test/drivers/test_suites/syscall_enter_suite/sendmsg_e.cpp index d839c22494..a4f65e5958 100644 --- a/test/drivers/test_suites/syscall_enter_suite/sendmsg_e.cpp +++ b/test/drivers/test_suites/syscall_enter_suite/sendmsg_e.cpp @@ -13,8 +13,7 @@ TEST(SyscallEnter, sendmsgE_ipv4_tcp) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendmsg}, receive_data{.skip_recv_phase = true}, - protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendmsg}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -53,8 +52,7 @@ TEST(SyscallEnter, sendmsgE_ipv4_tcp_NULL_sockaddr) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendmsg, .null_sockaddr = true}, - receive_data{.skip_recv_phase = true}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendmsg, .null_sockaddr = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -104,8 +102,7 @@ TEST(SyscallEnter, sendmsgE_ipv4_udp) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendmsg}, receive_data{.skip_recv_phase = true}, - protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendmsg}); /*=============================== TRIGGER SYSCALL ===========================*/ diff --git a/test/drivers/test_suites/syscall_enter_suite/sendto_e.cpp b/test/drivers/test_suites/syscall_enter_suite/sendto_e.cpp index 63a80f06b7..86a2c4b8a6 100644 --- a/test/drivers/test_suites/syscall_enter_suite/sendto_e.cpp +++ b/test/drivers/test_suites/syscall_enter_suite/sendto_e.cpp @@ -13,8 +13,7 @@ TEST(SyscallEnter, sendtoE_ipv4_tcp) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto}, receive_data{.skip_recv_phase = true}, - protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -53,8 +52,7 @@ TEST(SyscallEnter, sendtoE_ipv4_tcp_NULL_sockaddr) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .null_sockaddr = true}, - receive_data{.skip_recv_phase = true}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto, .null_sockaddr = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -104,8 +102,7 @@ TEST(SyscallEnter, sendtoE_ipv4_udp) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto}, receive_data{.skip_recv_phase = true}, - protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto}); /*=============================== TRIGGER SYSCALL ===========================*/ diff --git a/test/drivers/test_suites/syscall_exit_suite/read_x.cpp b/test/drivers/test_suites/syscall_exit_suite/read_x.cpp index d1919c568e..b7e8b7d025 100644 --- a/test/drivers/test_suites/syscall_exit_suite/read_x.cpp +++ b/test/drivers/test_suites/syscall_exit_suite/read_x.cpp @@ -153,8 +153,8 @@ TEST(SyscallExit, readX_ipv4_tcp_message_truncated_by_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_read}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_read}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -198,8 +198,8 @@ TEST(SyscallExit, readX_ipv4_tcp_message_not_truncated_fullcapture_port) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_read}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_read}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -244,8 +244,8 @@ TEST(SyscallExit, readX_ipv4_udp_message_truncated_by_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_read}, protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_read}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -287,8 +287,8 @@ TEST(SyscallExit, readX_ipv4_udp_message_truncated_fullcapture_client_port) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_read}, protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_read}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -332,16 +332,16 @@ TEST(SyscallExit, readX_ipv4_udp_message_not_truncated_fullcapture_server_port) evt_test->set_do_dynamic_snaplen(true); - // In this case we should be able to retrieve the server port from the kernel socket because it is the local port - // We are receiving on the server. + // In this case we should be able to retrieve the server port from the kernel socket because it is the local + // port We are receiving on the server. evt_test->set_fullcapture_port_range(IPV4_PORT_SERVER, IPV4_PORT_SERVER); evt_test->enable_capture(); /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_read}, protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_read}); /*=============================== TRIGGER SYSCALL ===========================*/ diff --git a/test/drivers/test_suites/syscall_exit_suite/recvfrom_x.cpp b/test/drivers/test_suites/syscall_exit_suite/recvfrom_x.cpp index fd729153d1..df39c369f8 100644 --- a/test/drivers/test_suites/syscall_exit_suite/recvfrom_x.cpp +++ b/test/drivers/test_suites/syscall_exit_suite/recvfrom_x.cpp @@ -16,8 +16,8 @@ TEST(SyscallExit, recvfromX_ipv4_tcp_message_not_truncated_by_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto}, - receive_data{.syscall_num = __NR_recvfrom}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto}, + recv_data{.syscall_num = __NR_recvfrom}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -61,8 +61,8 @@ TEST(SyscallExit, recvfromX_ipv4_tcp_message_truncated_by_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvfrom}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvfrom}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -109,8 +109,8 @@ TEST(SyscallExit, recvfromX_ipv4_tcp_message_not_truncated_fullcapture_port) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvfrom}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvfrom}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -165,8 +165,8 @@ TEST(SyscallExit, recvfromX_ipv6_tcp_message_not_truncated_fullcapture_port) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvfrom}, protocol_L3::IPv6, protocol_L4::TCP); + evt_test->client_to_server_ipv6_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvfrom}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -216,9 +216,8 @@ TEST(SyscallExit, recvfromX_ipv4_tcp_NULL_sockaddr) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvfrom, .null_sockaddr = true}, - protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvfrom, .null_sockaddr = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -270,9 +269,8 @@ TEST(SyscallExit, recvfromX_ipv4_tcp_message_not_truncated_fullcapture_port_NULL /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvfrom, .null_sockaddr = true}, - protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvfrom, .null_sockaddr = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -322,9 +320,8 @@ TEST(SyscallExit, recvfromX_ipv4_tcp_NULL_buffer) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvfrom, .null_receiver_buffer = true}, - protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvfrom, .null_receiver_buffer = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -369,8 +366,8 @@ TEST(SyscallExit, recvfromX_ipv4_udp_message_not_truncated_by_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto}, - receive_data{.syscall_num = __NR_recvfrom}, protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto}, + recv_data{.syscall_num = __NR_recvfrom}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -412,8 +409,8 @@ TEST(SyscallExit, recvfromX_ipv4_udp_message_truncated_by_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvfrom}, protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvfrom}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -460,8 +457,8 @@ TEST(SyscallExit, recvfromX_ipv4_udp_message_not_truncated_fullcapture_port) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvfrom}, protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvfrom}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -511,8 +508,8 @@ TEST(SyscallExit, recvfromX_ipv4_udp_NULL_sockaddr) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvfrom, .null_sockaddr = true}, protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvfrom, .null_sockaddr = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -564,8 +561,8 @@ TEST(SyscallExit, recvfromX_ipv4_udp_message_truncated_fullcapture_port_NULL_soc /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvfrom, .null_sockaddr = true}, protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvfrom, .null_sockaddr = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -615,8 +612,8 @@ TEST(SyscallExit, recvfromX_ipv4_udp_NULL_buffer) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvfrom, .null_receiver_buffer = true}, protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvfrom, .null_receiver_buffer = true}); /*=============================== TRIGGER SYSCALL ===========================*/ diff --git a/test/drivers/test_suites/syscall_exit_suite/recvmsg_x.cpp b/test/drivers/test_suites/syscall_exit_suite/recvmsg_x.cpp index b01bb8ef51..9334d852c5 100644 --- a/test/drivers/test_suites/syscall_exit_suite/recvmsg_x.cpp +++ b/test/drivers/test_suites/syscall_exit_suite/recvmsg_x.cpp @@ -16,8 +16,8 @@ TEST(SyscallExit, recvmsgX_ipv4_tcp_message_shorter_than_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto}, - receive_data{.syscall_num = __NR_recvmsg}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto}, + recv_data{.syscall_num = __NR_recvmsg}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -80,8 +80,8 @@ TEST(SyscallExit, recvmsgX_ipv4_tcp_message_longer_than_snaplen_truncated) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvmsg}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvmsg}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -127,8 +127,8 @@ TEST(SyscallExit, recvmsgX_ipv4_tcp_message_longer_than_snaplen_not_truncated_fu /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvmsg}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvmsg}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -181,8 +181,8 @@ TEST(SyscallExit, recvmsgX_ipv6_tcp_message_not_truncated_fullcapture_port) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvmsg}, protocol_L3::IPv6, protocol_L4::TCP); + evt_test->client_to_server_ipv6_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvmsg}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -230,9 +230,8 @@ TEST(SyscallExit, recvmsgX_ipv4_tcp_NULL_sockaddr) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvmsg, .null_sockaddr = true}, - protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvmsg, .null_sockaddr = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -294,9 +293,8 @@ TEST(SyscallExit, recvmsgX_ipv4_tcp_message_longer_than_snaplen_not_truncated_fu /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvmsg, .null_sockaddr = true}, - protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvmsg, .null_sockaddr = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -344,9 +342,8 @@ TEST(SyscallExit, recvmsgX_ipv4_tcp_NULL_buffer) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvmsg, .null_receiver_buffer = true}, - protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvmsg, .null_receiver_buffer = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -389,8 +386,8 @@ TEST(SyscallExit, recvmsgX_ipv4_udp_message_shorter_than_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto}, - receive_data{.syscall_num = __NR_recvmsg}, protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto}, + recv_data{.syscall_num = __NR_recvmsg}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -438,8 +435,8 @@ TEST(SyscallExit, recvmsgX_ipv4_udp_message_longer_than_snaplen_truncated) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvmsg}, protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvmsg}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -485,8 +482,8 @@ TEST(SyscallExit, recvmsgX_ipv4_udp_message_longer_than_snaplen_not_truncated_fu /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvmsg}, protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvmsg}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -531,9 +528,8 @@ TEST(SyscallExit, recvmsgX_ipv4_udp_NULL_sockaddr) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvmsg, .null_sockaddr = true}, - protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvmsg, .null_sockaddr = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -596,9 +592,8 @@ TEST(SyscallExit, recvmsgX_ipv4_udp_message_longer_than_snaplen_truncated_fullca /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvmsg, .null_sockaddr = true}, - protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvmsg, .null_sockaddr = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -643,9 +638,8 @@ TEST(SyscallExit, recvmsgX_ipv4_udp_NULL_buffer) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.syscall_num = __NR_recvmsg, .null_receiver_buffer = true}, - protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, + recv_data{.syscall_num = __NR_recvmsg, .null_receiver_buffer = true}); /*=============================== TRIGGER SYSCALL ===========================*/ diff --git a/test/drivers/test_suites/syscall_exit_suite/sendmsg_x.cpp b/test/drivers/test_suites/syscall_exit_suite/sendmsg_x.cpp index 96118e5985..064ce8a6ca 100644 --- a/test/drivers/test_suites/syscall_exit_suite/sendmsg_x.cpp +++ b/test/drivers/test_suites/syscall_exit_suite/sendmsg_x.cpp @@ -15,8 +15,7 @@ TEST(SyscallExit, sendmsgX_ipv4_tcp_message_not_truncated_by_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendmsg}, receive_data{.skip_recv_phase = true}, - protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendmsg}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -54,8 +53,7 @@ TEST(SyscallExit, sendmsgX_ipv4_tcp_message_truncated_by_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendmsg, .greater_snaplen = true}, - receive_data{.skip_recv_phase = true}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendmsg, .greater_snaplen = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -98,8 +96,7 @@ TEST(SyscallExit, sendmsgX_ipv4_tcp_message_not_truncated_fullcapture_port) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendmsg, .greater_snaplen = true}, - receive_data{.skip_recv_phase = true}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendmsg, .greater_snaplen = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -149,8 +146,7 @@ TEST(SyscallExit, sendmsgX_ipv6_tcp_message_not_truncated_fullcapture_port) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendmsg, .greater_snaplen = true}, - receive_data{.skip_recv_phase = true}, protocol_L3::IPv6, protocol_L4::TCP); + evt_test->client_to_server_ipv6_tcp(send_data{.syscall_num = __NR_sendmsg, .greater_snaplen = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -199,9 +195,8 @@ TEST(SyscallExit, sendmsgX_ipv4_tcp_message_not_truncated_fullcapture_port_NULL_ /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server( - send_data{.syscall_num = __NR_sendmsg, .greater_snaplen = true, .null_sockaddr = true}, - receive_data{.skip_recv_phase = true}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp( + send_data{.syscall_num = __NR_sendmsg, .greater_snaplen = true, .null_sockaddr = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -248,8 +243,7 @@ TEST(SyscallExit, sendmsgX_ipv4_udp_message_not_truncated_by_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendmsg}, receive_data{.skip_recv_phase = true}, - protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendmsg}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -287,8 +281,7 @@ TEST(SyscallExit, sendmsgX_ipv4_udp_message_truncated_by_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendmsg, .greater_snaplen = true}, - receive_data{.skip_recv_phase = true}, protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendmsg, .greater_snaplen = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -330,8 +323,7 @@ TEST(SyscallExit, sendmsgX_ipv4_udp_message_not_truncated_fullcapture_port) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendmsg, .greater_snaplen = true}, - receive_data{.skip_recv_phase = true}, protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendmsg, .greater_snaplen = true}); /*=============================== TRIGGER SYSCALL ===========================*/ diff --git a/test/drivers/test_suites/syscall_exit_suite/sendto_x.cpp b/test/drivers/test_suites/syscall_exit_suite/sendto_x.cpp index 4b452c7d93..3f4d9de611 100644 --- a/test/drivers/test_suites/syscall_exit_suite/sendto_x.cpp +++ b/test/drivers/test_suites/syscall_exit_suite/sendto_x.cpp @@ -15,8 +15,7 @@ TEST(SyscallExit, sendtoX_ipv4_tcp_message_not_truncated_by_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto}, receive_data{.skip_recv_phase = true}, - protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -54,8 +53,7 @@ TEST(SyscallExit, sendtoX_ipv4_tcp_message_truncated_by_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.skip_recv_phase = true}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -98,8 +96,7 @@ TEST(SyscallExit, sendtoX_ipv4_tcp_message_not_truncated_fullcapture_port) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.skip_recv_phase = true}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -149,8 +146,7 @@ TEST(SyscallExit, sendtoX_ipv6_tcp_message_not_truncated_fullcapture_port) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.skip_recv_phase = true}, protocol_L3::IPv6, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -199,9 +195,8 @@ TEST(SyscallExit, sendtoX_ipv4_tcp_message_not_truncated_fullcapture_port_NULL_s /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server( - send_data{.syscall_num = __NR_sendto, .greater_snaplen = true, .null_sockaddr = true}, - receive_data{.skip_recv_phase = true}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp( + send_data{.syscall_num = __NR_sendto, .greater_snaplen = true, .null_sockaddr = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -248,8 +243,7 @@ TEST(SyscallExit, sendtoX_ipv4_udp_message_not_truncated_by_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto}, receive_data{.skip_recv_phase = true}, - protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -287,8 +281,7 @@ TEST(SyscallExit, sendtoX_ipv4_udp_message_truncated_by_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.skip_recv_phase = true}, protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -330,8 +323,7 @@ TEST(SyscallExit, sendtoX_ipv4_udp_message_not_truncated_fullcapture_port) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}, - receive_data{.skip_recv_phase = true}, protocol_L3::IPv4, protocol_L4::UDP); + evt_test->client_to_server_ipv4_udp(send_data{.syscall_num = __NR_sendto, .greater_snaplen = true}); /*=============================== TRIGGER SYSCALL ===========================*/ diff --git a/test/drivers/test_suites/syscall_exit_suite/write_x.cpp b/test/drivers/test_suites/syscall_exit_suite/write_x.cpp index 79c4baf883..b29e873e10 100644 --- a/test/drivers/test_suites/syscall_exit_suite/write_x.cpp +++ b/test/drivers/test_suites/syscall_exit_suite/write_x.cpp @@ -188,8 +188,7 @@ TEST(SyscallExit, writeX_ipv4_tcp_message_truncated_by_snaplen) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_write, .greater_snaplen = true}, - receive_data{.skip_recv_phase = true}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_write, .greater_snaplen = true}); /*=============================== TRIGGER SYSCALL ===========================*/ @@ -231,8 +230,7 @@ TEST(SyscallExit, writeX_ipv4_tcp_message_not_truncated_fullcapture_port) /*=============================== TRIGGER SYSCALL ===========================*/ - evt_test->client_to_server(send_data{.syscall_num = __NR_write, .greater_snaplen = true}, - receive_data{.skip_recv_phase = true}, protocol_L3::IPv4, protocol_L4::TCP); + evt_test->client_to_server_ipv4_tcp(send_data{.syscall_num = __NR_write, .greater_snaplen = true}); /*=============================== TRIGGER SYSCALL ===========================*/