summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author maheshkkv <maheshkkv@google.com> 2025-02-16 12:09:45 -0800
committer maheshkkv <maheshkkv@google.com> 2025-02-20 14:22:11 -0800
commit3fb8c3592362c5654bcf5af04bf25a292c54519a (patch)
tree2e79e5477e3b3318bc4d639ad8d31dab5ccc0579
parent5367efaf3d0f647977ab1209b1ee457ec7c2eae6 (diff)
Add coverage for secure ranging in NetworkDetail
Bug: 397709104 Test: com.android.server.wifi.hotspot2.NetworkDetailTest Flag: TEST_ONLY Change-Id: I0c7a5557816f62c9bdf54993f515621a79fd8851
-rw-r--r--service/tests/wifitests/src/com/android/server/wifi/hotspot2/NetworkDetailTest.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/service/tests/wifitests/src/com/android/server/wifi/hotspot2/NetworkDetailTest.java b/service/tests/wifitests/src/com/android/server/wifi/hotspot2/NetworkDetailTest.java
index 707f2e81a7..fc3262d332 100644
--- a/service/tests/wifitests/src/com/android/server/wifi/hotspot2/NetworkDetailTest.java
+++ b/service/tests/wifitests/src/com/android/server/wifi/hotspot2/NetworkDetailTest.java
@@ -193,5 +193,34 @@ public class NetworkDetailTest extends WifiBaseTest {
TextUtils.equals(bssidStr1, bssidStr2));
}
}
+
+ /**
+ * Test IEEE 802.11az NTB Secure Ranging Parameters.
+ */
+ @Test
+ public void verifyIeee80211azNtbSecureRangingParameters() {
+ InformationElement[] ies = new InformationElement[2];
+
+ ies[0] = new InformationElement();
+ ies[0].id = InformationElement.EID_EXTENDED_CAPS;
+ ies[0].bytes = new byte[] { (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x00, (byte) 0x00, (byte) 0x00,
+ (byte) 0x00, (byte) 0x61, (byte) 0x00, (byte) 0x0c };
+
+ ies[1] = new InformationElement();
+ ies[1].id = InformationElement.EID_RSN_EXTENSION;
+ ies[1].bytes = new byte[]{
+ // Length
+ (byte) 0x02,
+ // Extended RSN capabilities - Secure HE-LTF and URNM-MFPR enabled
+ (byte) 0x81, (byte) 0x00,
+ };
+ NetworkDetail networkDetail = new NetworkDetail(TEST_BSSID, ies,
+ Collections.emptyList(), 5745);
+
+ assertTrue(networkDetail.is80211azNtbResponder());
+ assertTrue(networkDetail.isRangingFrameProtectionRequired());
+ assertTrue(networkDetail.isSecureHeLtfSupported());
+ }
}