tests: net: igmp: Add re-join multicast group test
Make sure we send IGMP report when re-joining the multicast group when interface goes up after operative down event. Signed-off-by: Jukka Rissanen <jukka.rissanen@nordicsemi.no>
This commit is contained in:
parent
24bf9c2334
commit
9fcf424d41
1 changed files with 21 additions and 0 deletions
|
|
@ -620,4 +620,25 @@ ZTEST_USER(net_igmp, test_igmpv2_query)
|
||||||
igmp_send_query(false);
|
igmp_send_query(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ZTEST_USER(net_igmp, test_group_rejoin)
|
||||||
|
{
|
||||||
|
/* It is enough if this is tested with IGMPv2 only because we do not
|
||||||
|
* really care about specific IGMP version here.
|
||||||
|
*/
|
||||||
|
if (IS_ENABLED(CONFIG_NET_IPV4_IGMPV3)) {
|
||||||
|
ztest_test_skip();
|
||||||
|
}
|
||||||
|
|
||||||
|
socket_join_group_with_index(&my_addr);
|
||||||
|
|
||||||
|
is_report_sent = false;
|
||||||
|
|
||||||
|
net_if_carrier_off(net_iface);
|
||||||
|
net_if_carrier_on(net_iface);
|
||||||
|
|
||||||
|
zassert_true(is_report_sent, "Did not catch query event");
|
||||||
|
|
||||||
|
socket_leave_group_with_index(&my_addr);
|
||||||
|
}
|
||||||
|
|
||||||
ZTEST_SUITE(net_igmp, NULL, igmp_setup, NULL, NULL, igmp_teardown);
|
ZTEST_SUITE(net_igmp, NULL, igmp_setup, NULL, NULL, igmp_teardown);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue