Fix flaky testDhcp6Pd_multipleIaPrefixOptions.
Kernel generates the multicast route on T devices something like
ff00::/8 -> :: testtap0 mtu 0, however, this route doesn't exist on
other version. Therefore, this test always fails when running on a
T device. Instead of checking how many routes a device gets via
onLinkPropertiesChange, we only consider the number of link address
on LinkProperties, it's a fixed number on all platforms.
Bug: 317024540
Test: atest testDhcp6Pd_multipleIaPrefixOptions --iterations
Change-Id: I373405175430c4ed15f3b9c22641690f94f769c9
diff --git a/tests/integration/common/android/net/ip/IpClientIntegrationTestCommon.java b/tests/integration/common/android/net/ip/IpClientIntegrationTestCommon.java
index b09cecf..143dae5 100644
--- a/tests/integration/common/android/net/ip/IpClientIntegrationTestCommon.java
+++ b/tests/integration/common/android/net/ip/IpClientIntegrationTestCommon.java
@@ -5448,12 +5448,12 @@
// Sometimes privacy address or route may appear later along with onLinkPropertiesChange
// callback, in this case we wait a bit longer to see all of these properties appeared and
// then verify if they are what we are looking for.
- if (lp.getLinkAddresses().size() < 5 || lp.getRoutes().size() < 4) {
+ if (lp.getLinkAddresses().size() < 5) { // 1 IPv6 link-local and 4 global IPv6 addresses
+ // derived from prefix1 and prefix2
final CompletableFuture<LinkProperties> lpFuture = new CompletableFuture<>();
verifyWithTimeout(inOrder, mCb).onLinkPropertiesChange(argThat(x -> {
if (!x.isIpv6Provisioned()) return false;
if (x.getLinkAddresses().size() != 5) return false;
- if (x.getRoutes().size() != 4) return false;
lpFuture.complete(x);
return true;
}));