Skip to content

Commit

Permalink
tests: validating new listener hooks
Browse files Browse the repository at this point in the history
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) <[email protected]>
  • Loading branch information
matttbe committed Oct 9, 2024
1 parent 67bb520 commit 8d975d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/lib/test-plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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,
Expand All @@ -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
};
///@}

Expand Down
2 changes: 2 additions & 0 deletions tests/test-plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8d975d7

Please sign in to comment.