From 8d975d7f55bfa1b1e4134c31f1a83b1d7b273cfa Mon Sep 17 00:00:00 2001 From: "Matthieu Baerts (NGI0)" Date: Wed, 9 Oct 2024 12:11:13 +0200 Subject: [PATCH] tests: validating new listener hooks Tests 1 and 2 are imitating the server side: a new listening socket is created. Not in the other ones, imitating the client side. Also validate the null plugin. Signed-off-by: Matthieu Baerts (NGI0) --- tests/lib/test-plugin.h | 10 ++++++++-- tests/test-plugin.c | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/lib/test-plugin.h b/tests/lib/test-plugin.h index 77e60ddf..284b1aca 100644 --- a/tests/lib/test-plugin.h +++ b/tests/lib/test-plugin.h @@ -99,7 +99,9 @@ static struct plugin_call_count const test_count_1 = { .address_removed = 0, .new_subflow = 0, .subflow_closed = 0, - .subflow_priority = 0 + .subflow_priority = 0, + .listener_created = 1, + .listener_closed = 1 }; static struct plugin_call_count const test_count_2 = { @@ -111,6 +113,8 @@ static struct plugin_call_count const test_count_2 = { .new_subflow = 1, .subflow_closed = 1, .subflow_priority = 1, + .listener_created = 1, + .listener_closed = 1, .new_interface = 1, .update_interface = 2, .delete_interface = 1, @@ -126,7 +130,9 @@ static struct plugin_call_count const test_count_4 = { .address_removed = 1, .new_subflow = 0, .subflow_closed = 0, - .subflow_priority = 0 + .subflow_priority = 0, + .listener_created = 0, + .listener_closed = 0 }; ///@} diff --git a/tests/test-plugin.c b/tests/test-plugin.c index e32fe301..15fec1b5 100644 --- a/tests/test-plugin.c +++ b/tests/test-plugin.c @@ -311,6 +311,8 @@ static void test_null_plugin_ops(void const *test_data) mptcpd_plugin_new_subflow(token, laddr, raddr, backup, pm); mptcpd_plugin_subflow_closed(token, laddr, raddr, backup, pm); mptcpd_plugin_subflow_priority(token, laddr, raddr, backup, pm); + mptcpd_plugin_listener_created(name, laddr, pm); + mptcpd_plugin_listener_closed(name, laddr, pm); mptcpd_plugin_new_interface(interface, pm); mptcpd_plugin_update_interface(interface, pm); mptcpd_plugin_delete_interface(interface, pm);