tests: net: mld: fix waiting for MLDv2 report after query
This commit fixes 'test_verify_send_report()' function as it was not properly waiting for a MLDv2 report after sending a query. The asserted value was set for the previous report sent after joining a group. Signed-off-by: Konrad Derda <konrad.derda@nordicsemi.no>
This commit is contained in:
parent
377756e0f9
commit
d4dc516119
2 changed files with 19 additions and 5 deletions
|
@ -21,5 +21,5 @@ CONFIG_NET_BUF_TX_COUNT=20
|
||||||
CONFIG_NET_MGMT=y
|
CONFIG_NET_MGMT=y
|
||||||
CONFIG_NET_MGMT_EVENT=y
|
CONFIG_NET_MGMT_EVENT=y
|
||||||
CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=4
|
CONFIG_NET_IF_UNICAST_IPV6_ADDR_COUNT=4
|
||||||
CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=4
|
CONFIG_NET_IF_MCAST_IPV6_ADDR_COUNT=5
|
||||||
CONFIG_NET_SOCKETS=y
|
CONFIG_NET_SOCKETS=y
|
||||||
|
|
|
@ -484,25 +484,39 @@ static void test_catch_query(void)
|
||||||
|
|
||||||
static void test_verify_send_report(void)
|
static void test_verify_send_report(void)
|
||||||
{
|
{
|
||||||
|
join_mldv2_capable_routers_group();
|
||||||
|
|
||||||
is_query_received = false;
|
is_query_received = false;
|
||||||
is_report_sent = false;
|
is_report_sent = false;
|
||||||
|
|
||||||
ignore_already = true;
|
ignore_already = true;
|
||||||
|
|
||||||
|
k_sem_reset(&wait_data);
|
||||||
|
|
||||||
test_join_group();
|
test_join_group();
|
||||||
|
|
||||||
|
k_yield();
|
||||||
|
|
||||||
|
/* Did we send a report? */
|
||||||
|
if (k_sem_take(&wait_data, K_MSEC(WAIT_TIME))) {
|
||||||
|
zassert_true(0, "Timeout while waiting for report");
|
||||||
|
}
|
||||||
|
|
||||||
|
k_sem_reset(&wait_data);
|
||||||
|
|
||||||
|
is_report_sent = false;
|
||||||
send_query(net_if_get_first_by_type(&NET_L2_GET_NAME(DUMMY)));
|
send_query(net_if_get_first_by_type(&NET_L2_GET_NAME(DUMMY)));
|
||||||
|
|
||||||
k_yield();
|
k_yield();
|
||||||
|
|
||||||
/* Did we send a report? */
|
/* Did we send a report? */
|
||||||
if (k_sem_take(&wait_data, K_MSEC(WAIT_TIME))) {
|
if (k_sem_take(&wait_data, K_MSEC(WAIT_TIME))) {
|
||||||
zassert_true(0, "Timeout while waiting report");
|
zassert_true(0, "Timeout while waiting for report");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_report_sent) {
|
zassert_true(is_report_sent, "Report not sent");
|
||||||
zassert_true(0, "Report not sent");
|
|
||||||
}
|
leave_mldv2_capable_routers_group();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* This value should be longer that the one in net_if.c when DAD timeouts */
|
/* This value should be longer that the one in net_if.c when DAD timeouts */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue