diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2020-05-11 08:34:58 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-05-11 08:34:58 +0000 |
commit | a3a81e400096c0393ef35bde20bff7fd23f77080 (patch) | |
tree | 33b5f55f83b976a24364d1e44bf9351a4a2dfcb1 | |
parent | c5182b5e8357d73a45bcb6e32bb708d0e7826422 (diff) | |
parent | bd967a001d76b8736ebc008228fa5b0c9cc6e758 (diff) |
Test that IFA_F_STABLE_PRIVACY appears in LinkAddresses. am: a90dec3838 am: bd967a001d
Change-Id: I7a7dc04dbd5c26def8020c378954572a2823495e
-rw-r--r-- | tests/integration/src/android/net/ip/IpClientIntegrationTest.java | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/integration/src/android/net/ip/IpClientIntegrationTest.java b/tests/integration/src/android/net/ip/IpClientIntegrationTest.java index d883433..5625dd2 100644 --- a/tests/integration/src/android/net/ip/IpClientIntegrationTest.java +++ b/tests/integration/src/android/net/ip/IpClientIntegrationTest.java @@ -188,6 +188,9 @@ public class IpClientIntegrationTest { private static final String TEST_GROUPHINT = "some grouphint"; private static final int TEST_LEASE_DURATION_S = 3_600; // 1 hour + // TODO: move to NetlinkConstants, NetworkStackConstants, or OsConstants. + private static final int IFA_F_STABLE_PRIVACY = 0x800; + @Rule public final DevSdkIgnoreRule mIgnoreRule = new DevSdkIgnoreRule(); @@ -1385,9 +1388,9 @@ public class IpClientIntegrationTest { } private boolean isStablePrivacyAddress(LinkAddress addr) { - // TODO: this is incorrect. Fix netd to report IFA_F_STABLE_PRIVACY on R onwards, and then - // move away from getting addresses from netd altogether. - return addr.isGlobalPreferred(); + // TODO: move away from getting address updates from netd and make this work on Q as well. + final int flag = ShimUtils.isAtLeastR() ? IFA_F_STABLE_PRIVACY : 0; + return addr.isGlobalPreferred() && hasFlag(addr, flag); } private LinkProperties doIpv6OnlyProvisioning(InOrder inOrder, ByteBuffer ra) throws Exception { |