From 0a3f56dbe29b2a4e699854e65e7a3be29f92d1c7 Mon Sep 17 00:00:00 2001 From: Federico Di Pierro Date: Tue, 3 Oct 2023 11:51:56 +0200 Subject: [PATCH] chore(test): send an unexistent SYS_ code too. Signed-off-by: Federico Di Pierro --- test/drivers/helpers/ia32.c | 1 + .../test_suites/actions_suite/ia32.cpp.in | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/test/drivers/helpers/ia32.c b/test/drivers/helpers/ia32.c index 47249877e5..e18fe1b2f3 100644 --- a/test/drivers/helpers/ia32.c +++ b/test/drivers/helpers/ia32.c @@ -16,5 +16,6 @@ int main() { syscall(__NR_socketcall, SYS_ACCEPT4, args); syscall(__NR_socketcall, SYS_SEND, args); syscall(__NR_socketcall, SYS_ACCEPT, args); + syscall(__NR_socketcall, -1, args); return 0; } \ No newline at end of file diff --git a/test/drivers/test_suites/actions_suite/ia32.cpp.in b/test/drivers/test_suites/actions_suite/ia32.cpp.in index e99d552579..9b9d5d2795 100644 --- a/test/drivers/test_suites/actions_suite/ia32.cpp.in +++ b/test/drivers/test_suites/actions_suite/ia32.cpp.in @@ -66,6 +66,13 @@ TEST(Actions, ia32) */ evt_test->assert_event_absence(ret_pid, PPME_SOCKET_ACCEPT4_6_E); evt_test->assert_event_absence(ret_pid, PPME_SOCKET_ACCEPT4_6_X); + + /* + * Last event sent by the script is a socketcall with non existing SYS_ code. + * We don't expect any event generated. + */ + evt_test->assert_event_absence(ret_pid, PPME_GENERIC_E); + evt_test->assert_event_absence(ret_pid, PPME_GENERIC_X); } else { @@ -76,8 +83,18 @@ TEST(Actions, ia32) evt_test->assert_event_presence(ret_pid, PPME_SOCKET_SEND_E); evt_test->assert_event_presence(ret_pid, PPME_SOCKET_SEND_X); + /* + * Same as above + */ evt_test->assert_event_presence(ret_pid, PPME_SOCKET_ACCEPT_5_E); evt_test->assert_event_presence(ret_pid, PPME_SOCKET_ACCEPT_5_X); + + /* + * Last event sent by the script is a socketcall with non existing SYS_ code. + * We expect generic events to be pushed. + */ + evt_test->assert_event_presence(ret_pid, PPME_GENERIC_E); + evt_test->assert_event_presence(ret_pid, PPME_GENERIC_X); } } #endif \ No newline at end of file