diff options
author | xshu <xshu@google.com> | 2020-05-11 17:24:00 -0700 |
---|---|---|
committer | xshu <xshu@google.com> | 2020-05-12 19:21:36 -0700 |
commit | a9af37006b20d012ab7dcd329c088cb8d0795289 (patch) | |
tree | 100b93471396d86c7d686dc79c61c3c8f569eded /tests | |
parent | b980e07ab21af7d26a046729202606d1ff9fcab9 (diff) |
BssidBlocklistMonitor history
It's been found that often the local log does not cover enough time for
Bssid blocklist related debugging. This change will make sure that we
will get data on the latest 30 unblocked BSSIDs during bugreport dump.
Bug: 156004955
Test: atest com.android.server.wifi
Change-Id: I16efa8cae4b2cabdc5727aab214b66ccee465a5c
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java b/tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java index 2567faa91..4369a831b 100644 --- a/tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java +++ b/tests/wifitests/src/com/android/server/wifi/BssidBlocklistMonitorTest.java @@ -582,6 +582,24 @@ public class BssidBlocklistMonitorTest { verifyAddTestBssidToBlocklist(); mBssidBlocklistMonitor.clearBssidBlocklist(); assertEquals(0, mBssidBlocklistMonitor.updateAndGetBssidBlocklist().size()); + + } + + /** + * Verify that the BssidStatusHistoryLoggerSize is capped. + */ + @Test + public void testBssidStatusHistoryLoggerSize() { + int bssidStatusHistoryLoggerSize = 30; + for (int i = 0; i < bssidStatusHistoryLoggerSize; i++) { + verifyAddTestBssidToBlocklist(); + mBssidBlocklistMonitor.clearBssidBlocklist(); + assertEquals(i + 1, mBssidBlocklistMonitor.getBssidStatusHistoryLoggerSize()); + } + verifyAddTestBssidToBlocklist(); + mBssidBlocklistMonitor.clearBssidBlocklist(); + assertEquals(bssidStatusHistoryLoggerSize, + mBssidBlocklistMonitor.getBssidStatusHistoryLoggerSize()); } /** @@ -633,6 +651,7 @@ public class BssidBlocklistMonitorTest { // Verify that the BSSID is removed from blocklist by clearBssidBlocklistForSsid mBssidBlocklistMonitor.clearBssidBlocklistForSsid(TEST_SSID_1); assertEquals(0, mBssidBlocklistMonitor.updateAndGetBssidBlocklist().size()); + assertEquals(1, mBssidBlocklistMonitor.getBssidStatusHistoryLoggerSize()); // Add the BSSID to blocklist again. mBssidBlocklistMonitor.blockBssidForDurationMs(TEST_BSSID_1, TEST_SSID_1, testDuration); @@ -641,5 +660,6 @@ public class BssidBlocklistMonitorTest { // Verify that the BSSID is removed from blocklist once the specified duration is over. when(mClock.getWallClockMillis()).thenReturn(testDuration + 1); assertEquals(0, mBssidBlocklistMonitor.updateAndGetBssidBlocklist().size()); + assertEquals(2, mBssidBlocklistMonitor.getBssidStatusHistoryLoggerSize()); } } |