summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKai Shi <kaishi@google.com>2020-03-16 12:32:12 -0700
committerKai Shi <kaishi@google.com>2020-03-17 09:50:39 -0700
commitff2f8700ec8861ad056cb84a124b7dd3e10b90dd (patch)
tree064625922d6ca3b9f8d132a2442c784f02a86a32 /tests
parente515bfc4b3c2e39be82459e39f8a47b93302471c (diff)
Add maxSupportedLinkSpeed in WifiMetrics.
Log maxSupportedLinkSpeed in connection event metrics to capture operation channel BW and maximum number of spatial streams supported by Wifi networks. Bug: 151648162 Test: manual test run the following command and confirm maxSupportTxLinkSpeed adb shell dumpsys wifi | grep mConnectionEvents Test: atest com.android.server.wifi Change-Id: Iead20d0b05a6650ef84d655d158016b6d1abee3f
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java1
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java22
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
index 7e9c6a292..2ffa52f83 100644
--- a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java
@@ -1032,6 +1032,7 @@ public class ClientModeImplTest extends WifiBaseTest {
verify(mWifiLockManager).updateWifiClientConnected(true);
verify(mWifiNative).getConnectionCapabilities(any());
verify(mThroughputPredictor).predictMaxTxThroughput(any());
+ verify(mWifiMetrics).setConnectionMaxSupportedLinkSpeedMbps(90, 80);
verify(mWifiDataStall).setConnectionCapabilities(any());
assertEquals(90, wifiInfo.getMaxSupportedTxLinkSpeedMbps());
}
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
index 34b365f43..abaf62841 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiMetricsTest.java
@@ -452,6 +452,8 @@ public class WifiMetricsTest extends WifiBaseTest {
private static final boolean IS_MAC_RANDOMIZATION_ON = true;
private static final int NUM_LINK_SPEED_LEVELS_TO_INCREMENT = 30;
private static final int TEST_RSSI_LEVEL = -80;
+ private static final int MAX_SUPPORTED_TX_LINK_SPEED_MBPS = 144;
+ private static final int MAX_SUPPORTED_RX_LINK_SPEED_MBPS = 190;
private ScanDetail buildMockScanDetail(boolean hidden, NetworkDetail.HSRelease hSRelease,
String capabilities) {
@@ -2514,6 +2516,26 @@ public class WifiMetricsTest extends WifiBaseTest {
}
/**
+ * Check max supported link speed
+ */
+ @Test
+ public void testConnectionMaxSupportedLinkSpeed() throws Exception {
+ mWifiMetrics.startConnectionEvent(mTestWifiConfig, "TestNetwork",
+ WifiMetricsProto.ConnectionEvent.ROAM_ENTERPRISE);
+ mWifiMetrics.setConnectionMaxSupportedLinkSpeedMbps(MAX_SUPPORTED_TX_LINK_SPEED_MBPS,
+ MAX_SUPPORTED_RX_LINK_SPEED_MBPS);
+ mWifiMetrics.endConnectionEvent(
+ WifiMetrics.ConnectionEvent.FAILURE_NONE,
+ WifiMetricsProto.ConnectionEvent.HLF_NONE,
+ WifiMetricsProto.ConnectionEvent.FAILURE_REASON_UNKNOWN);
+ dumpProtoAndDeserialize();
+ assertEquals(MAX_SUPPORTED_TX_LINK_SPEED_MBPS, mDecodedProto.connectionEvent[0]
+ .routerFingerprint.maxSupportedTxLinkSpeedMbps);
+ assertEquals(MAX_SUPPORTED_RX_LINK_SPEED_MBPS, mDecodedProto.connectionEvent[0]
+ .routerFingerprint.maxSupportedRxLinkSpeedMbps);
+ }
+
+ /**
* Check ScoringParams
*/
@Test