diff options
author | Francesco Giudici <fgiudici@redhat.com> | 2017-05-30 19:00:54 +0200 |
---|---|---|
committer | Francesco Giudici <fgiudici@redhat.com> | 2017-05-30 19:00:54 +0200 |
commit | 21a941d40b6619a6243aa561b2c8d4573fccfc34 (patch) | |
tree | 829dd20f95d193eb8664de8e60a1bc390ae2eac2 | |
parent | 84f2d226b54a7945a493a14d8ba0b15c75813892 (diff) | |
download | NetworkManager-21a941d40b6619a6243aa561b2c8d4573fccfc34.tar.gz |
platform/tests: fix test_ip6_route_options
when adding a route with RTA_PREFSRC some kernel versions will reject
the request if the specified source address is still tentative: be sure
that the just added addresses are no more tentative before adding the
routes.
-rw-r--r-- | src/platform/tests/test-route.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/platform/tests/test-route.c b/src/platform/tests/test-route.c index 258cfc1b25..fc395c84ef 100644 --- a/src/platform/tests/test-route.c +++ b/src/platform/tests/test-route.c @@ -493,6 +493,22 @@ test_ip6_route_options (gconstpointer test_data) addr[i].n_ifa_flags)); } + /* Wait that the addresses become non-tentative. Dummy interfaces are NOARP + * and thus don't do DAD, but the kernel sets the address as tentative for a + * small amount of time, which prevents the immediate addition of the route + * with RTA_PREFSRC */ + for (i = 0; i < addr_n; i++) { + NMTST_WAIT_ASSERT (200, { + const NMPlatformIP6Address *plt_addr; + + nmtstp_wait_for_signal (NM_PLATFORM_GET, 50); + nm_platform_process_events (NM_PLATFORM_GET); + plt_addr = nm_platform_ip6_address_get (NM_PLATFORM_GET, addr[i].ifindex, addr[i].address); + if (plt_addr && !NM_FLAGS_HAS (plt_addr->n_ifa_flags, IFA_F_TENTATIVE)) + break; + }); + } + for (i = 0; i < rts_n; i++) g_assert (nm_platform_ip6_route_add (NM_PLATFORM_GET, &rts_add[i])); |