summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-11-08 22:58:40 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-11-08 22:58:40 +0000
commitfbbf194677e228c8efb581270c3c6d9f2d7f77f0 (patch)
treefd9cd5e138b2e532fa2a481560f12cbecf73ff41 /tests
parent60b1df7a8c879e00b86d4ca1d3d7edfcac42f5fc (diff)
parent27544a5140b9b33f9c77690d524dea21235744f3 (diff)
Merge "[WifiRtt] add check to verify bw and preamble combination valid"
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/rtt/RttNativeTest.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/rtt/RttNativeTest.java b/tests/wifitests/src/com/android/server/wifi/rtt/RttNativeTest.java
index 1b93bb02f..d57857d64 100644
--- a/tests/wifitests/src/com/android/server/wifi/rtt/RttNativeTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/rtt/RttNativeTest.java
@@ -45,6 +45,7 @@ import android.hardware.wifi.V1_0.WifiStatusCode;
import android.net.MacAddress;
import android.net.wifi.rtt.RangingRequest;
import android.net.wifi.rtt.RangingResult;
+import android.net.wifi.rtt.ResponderConfig;
import androidx.test.filters.SmallTest;
@@ -476,6 +477,28 @@ public class RttNativeTest extends WifiBaseTest {
}
}
+ /**
+ * Validation ranging with invalid bw and preamble combination will be ignored.
+ */
+ @Test
+ public void testRangingWithInvalidParameterCombination() throws Exception {
+ int cmdId = 88;
+ RangingRequest request = new RangingRequest.Builder().build();
+ ResponderConfig invalidConfig = new ResponderConfig(
+ MacAddress.fromString("08:09:08:07:06:88"), ResponderConfig.RESPONDER_AP, true,
+ ResponderConfig.CHANNEL_WIDTH_80MHZ, 0, 0, 0, ResponderConfig.PREAMBLE_HT);
+ ResponderConfig config = new ResponderConfig(MacAddress.fromString("08:09:08:07:06:89"),
+ ResponderConfig.RESPONDER_AP, true,
+ ResponderConfig.CHANNEL_WIDTH_80MHZ, 0, 0, 0, ResponderConfig.PREAMBLE_VHT);
+
+ // Add a ResponderConfig with invalid parameter, should be ignored.
+ request.mRttPeers.add(invalidConfig);
+ request.mRttPeers.add(config);
+ mDut.rangeRequest(cmdId, request, true);
+ verify(mockRttController).rangeRequest(eq(cmdId), mRttConfigCaptor.capture());
+ assertEquals(request.mRttPeers.size() - 1, mRttConfigCaptor.getValue().size());
+ }
+
// Utilities
/**