Skip to content

Commit

Permalink
update(test/drivers): handle msgcontrol parameters also in socketcall…
Browse files Browse the repository at this point in the history
… tests

Signed-off-by: Lorenzo Susini <susinilorenzo1@gmail.com>
  • Loading branch information
loresuso committed Oct 12, 2023
1 parent ed5ff00 commit 73ad7c5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion test/drivers/test_suites/syscall_exit_suite/recvmsg_x.cpp
Expand Up @@ -590,7 +590,7 @@ TEST(SyscallExit, recvmsg_ancillary_data)
assert_syscall_state(SYSCALL_SUCCESS, "sendmsg (client)", sent_bytes, NOT_EQUAL, -1);;

int wstatus;
waitpid(-1, &wstatus, 0);
waitpid(pid, &wstatus, 0);

syscall(__NR_shutdown, sock);
syscall(__NR_close, sock);
Expand Down
19 changes: 15 additions & 4 deletions test/drivers/test_suites/syscall_exit_suite/socketcall_x.cpp
Expand Up @@ -2026,13 +2026,16 @@ TEST(SyscallExit, socketcall_recvmsgX_no_snaplen)
/// but these could be empty so this is not the correct way to retrieve information we have to
/// change it.
evt_test->assert_empty_param(4);
evt_test->assert_num_params_pushed(4);
evt_test->assert_num_params_pushed(5);
GTEST_SKIP() << "[RECVMSG_X]: what we receive is correct but we need to reimplement it, see the code" << std::endl;
}

/* Parameter 5: msg_control (type: PT_BYTEBUF) */
evt_test->assert_empty_param(5);

/*=============================== ASSERT PARAMETERS ===========================*/

evt_test->assert_num_params_pushed(4);
evt_test->assert_num_params_pushed(5);
}

TEST(SyscallExit, socketcall_recvmsgX_snaplen)
Expand Down Expand Up @@ -2128,13 +2131,16 @@ TEST(SyscallExit, socketcall_recvmsgX_snaplen)
/// but these could be empty so this is not the correct way to retrieve information we have to
/// change it.
evt_test->assert_empty_param(4);
evt_test->assert_num_params_pushed(4);
evt_test->assert_num_params_pushed(5);
GTEST_SKIP() << "[RECVMSG_X]: what we receive is correct but we need to reimplement it, see the code" << std::endl;
}

/* Parameter 5: msg_control (type: PT_BYTEBUF) */
evt_test->assert_empty_param(5);

/*=============================== ASSERT PARAMETERS ===========================*/

evt_test->assert_num_params_pushed(4);
evt_test->assert_num_params_pushed(5);
}
#endif

Expand Down Expand Up @@ -2186,7 +2192,12 @@ TEST(SyscallExit, socketcall_recvmsgX_fail)
/* Parameter 4: tuple (type: PT_SOCKTUPLE) */
evt_test->assert_empty_param(4);

/* Parameter 5: msg_control (type: PT_BYTEBUF) */
evt_test->assert_empty_param(5);

/*=============================== ASSERT PARAMETERS ===========================*/

evt_test->assert_num_params_pushed(5);
}

#endif
Expand Down

0 comments on commit 73ad7c5

Please sign in to comment.