Skip to content

Commit d490358

Browse files
Flavio Ceolinnashif
authored andcommitted
tests: ipv6: Fix DAD timeout test
DAD timeout was wrongly checking the reply order. The code will always assign sequentially the reply to 0-2 with the current uptime. This means that we will always have dad[0] < dad[1] < dad[2]. Check it is useless. Instead, let just check if we got all replies. The test checking the time between the first and last request is to fragile. It is testing a constant independently of the tested platform failing in several of them. Just remove it. Signed-off-by: Flavio Ceolin <[email protected]>
1 parent 97a55d6 commit d490358

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

tests/net/ipv6/src/main.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,14 +1106,9 @@ static void test_dad_timeout(void)
11061106

11071107
k_sleep(K_MSEC(200));
11081108

1109-
/* We should have received three DAD queries, make sure they are in
1110-
* proper order.
1111-
*/
1112-
zassert_true(dad_time[0] < dad_time[1], "DAD timer 1+2 failure");
1113-
zassert_true(dad_time[1] < dad_time[2], "DAD timer 2+3 failure");
1114-
zassert_true((dad_time[2] - dad_time[0]) < 100,
1115-
"DAD timers took too long time [%u] [%u] [%u]",
1116-
dad_time[0], dad_time[1], dad_time[2]);
1109+
/* Check we have received three DAD queries */
1110+
zassert_true((dad_time[0] != 0U) && (dad_time[1] != 0U) &&
1111+
(dad_time[2] != 0U), "Did not get DAD reply");
11171112
#endif
11181113
}
11191114

0 commit comments

Comments
 (0)