Fix CTS test failure for WifiConnectedNetworkScorer in DBS mode
In DBS mode, some of the link layer stats (e.g., radio on time) on one radio could be exactly zero when
WiFi connection is using the other radio. Allow zero values in the CTS test for link layer stats.
Bug: 161262848
Test: atest android.net.wifi.cts.ConnectedNetworkScorerTest
Signed-off-by: Mingguang Xu <mingguangxu@google.com>
Change-Id: I0b8ff7563a485beea9398cf96c23e3e38cef1c23
(cherry picked from commit 7804ea86d2499d1441789007e67f3acfe09917d3)
diff --git a/tests/tests/wifi/src/android/net/wifi/cts/ConnectedNetworkScorerTest.java b/tests/tests/wifi/src/android/net/wifi/cts/ConnectedNetworkScorerTest.java
index bcb2e43..865243e 100644
--- a/tests/tests/wifi/src/android/net/wifi/cts/ConnectedNetworkScorerTest.java
+++ b/tests/tests/wifi/src/android/net/wifi/cts/ConnectedNetworkScorerTest.java
@@ -175,25 +175,25 @@
assertThat(statsEntry.getTimeStampMillis()).isGreaterThan(0L);
assertThat(statsEntry.getRssi()).isLessThan(0);
- assertThat(statsEntry.getLinkSpeedMbps()).isGreaterThan(0);
- assertThat(statsEntry.getTotalTxSuccess()).isGreaterThan(0L);
+ assertThat(statsEntry.getLinkSpeedMbps()).isAtLeast(0);
+ assertThat(statsEntry.getTotalTxSuccess()).isAtLeast(0L);
assertThat(statsEntry.getTotalTxRetries()).isAtLeast(0L);
assertThat(statsEntry.getTotalTxBad()).isAtLeast(0L);
assertThat(statsEntry.getTotalRxSuccess()).isAtLeast(0L);
if (mWifiManager.isEnhancedPowerReportingSupported()) {
- assertThat(statsEntry.getTotalRadioOnTimeMillis()).isGreaterThan(0L);
- assertThat(statsEntry.getTotalRadioTxTimeMillis()).isGreaterThan(0L);
- assertThat(statsEntry.getTotalRadioRxTimeMillis()).isGreaterThan(0L);
- assertThat(statsEntry.getTotalScanTimeMillis()).isGreaterThan(0L);
+ assertThat(statsEntry.getTotalRadioOnTimeMillis()).isAtLeast(0L);
+ assertThat(statsEntry.getTotalRadioTxTimeMillis()).isAtLeast(0L);
+ assertThat(statsEntry.getTotalRadioRxTimeMillis()).isAtLeast(0L);
+ assertThat(statsEntry.getTotalScanTimeMillis()).isAtLeast(0L);
assertThat(statsEntry.getTotalNanScanTimeMillis()).isAtLeast(0L);
assertThat(statsEntry.getTotalBackgroundScanTimeMillis()).isAtLeast(0L);
assertThat(statsEntry.getTotalRoamScanTimeMillis()).isAtLeast(0L);
assertThat(statsEntry.getTotalPnoScanTimeMillis()).isAtLeast(0L);
assertThat(statsEntry.getTotalHotspot2ScanTimeMillis()).isAtLeast(0L);
assertThat(statsEntry.getTotalCcaBusyFreqTimeMillis()).isAtLeast(0L);
- assertThat(statsEntry.getTotalRadioOnTimeMillis()).isGreaterThan(0L);
- assertThat(statsEntry.getTotalRadioOnFreqTimeMillis()).isGreaterThan(0L);
- assertThat(statsEntry.getTotalBeaconRx()).isGreaterThan(0L);
+ assertThat(statsEntry.getTotalRadioOnTimeMillis()).isAtLeast(0L);
+ assertThat(statsEntry.getTotalRadioOnFreqTimeMillis()).isAtLeast(0L);
+ assertThat(statsEntry.getTotalBeaconRx()).isAtLeast(0L);
assertThat(statsEntry.getProbeStatusSinceLastUpdate())
.isAnyOf(PROBE_STATUS_SUCCESS,
PROBE_STATUS_FAILURE,