diff options
author | Oscar Shu <xshu@google.com> | 2019-12-02 18:40:47 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-12-02 18:40:47 +0000 |
commit | 10945006c172ca71cf2de64ee7a70a9f00fd43bf (patch) | |
tree | 303f51a1ffda507a663d3f92b09c5eb86fe0ba96 /tests | |
parent | 1369ef2a467dd13aa67ff3a0a85e21f0a52b73fe (diff) | |
parent | 9f67db616a8317ca00941658d2679b78293f0d44 (diff) |
Merge "Don't trigger watchdog for network related failures"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java index 48d016ae9..61ca10e53 100644 --- a/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/ClientModeImplTest.java @@ -2951,8 +2951,8 @@ public class ClientModeImplTest extends WifiBaseTest { } /** - * Verifies that WifiLastResortWatchdog and BssidBlocklistMonitor is notified of - * association rejection of type REASON_CODE_AP_UNABLE_TO_HANDLE_NEW_STA. + * Verifies that the BssidBlocklistMonitor is notified, but the WifiLastResortWatchdog is + * not notified of association rejections of type REASON_CODE_AP_UNABLE_TO_HANDLE_NEW_STA. * @throws Exception */ @Test @@ -2963,7 +2963,7 @@ public class ClientModeImplTest extends WifiBaseTest { mCmi.sendMessage(WifiMonitor.ASSOCIATION_REJECTION_EVENT, 0, ClientModeImpl.REASON_CODE_AP_UNABLE_TO_HANDLE_NEW_STA, sBSSID); mLooper.dispatchAll(); - verify(mWifiLastResortWatchdog).noteConnectionFailureAndTriggerIfNeeded( + verify(mWifiLastResortWatchdog, never()).noteConnectionFailureAndTriggerIfNeeded( anyString(), anyString(), anyInt()); verify(mBssidBlocklistMonitor).handleBssidConnectionFailure(sBSSID, sSSID, BssidBlocklistMonitor.REASON_AP_UNABLE_TO_HANDLE_NEW_STA); @@ -3008,6 +3008,27 @@ public class ClientModeImplTest extends WifiBaseTest { } /** + * Verifies that WifiLastResortWatchdog is not notified of authentication failures of type + * ERROR_AUTH_FAILURE_EAP_FAILURE. + * @throws Exception + */ + @Test + public void testEapFailureIsIgnoredByWatchdog() throws Exception { + // Setup CONNECT_MODE & a WifiConfiguration + initializeAndAddNetworkAndVerifySuccess(); + mCmi.sendMessage(ClientModeImpl.CMD_START_CONNECT, 0, 0, sBSSID); + mCmi.sendMessage(WifiMonitor.SUPPLICANT_STATE_CHANGE_EVENT, 0, 0, + new StateChangeResult(0, sWifiSsid, sBSSID, SupplicantState.COMPLETED)); + mCmi.sendMessage(WifiMonitor.AUTHENTICATION_FAILURE_EVENT, + WifiManager.ERROR_AUTH_FAILURE_EAP_FAILURE); + mLooper.dispatchAll(); + verify(mWifiLastResortWatchdog, never()).noteConnectionFailureAndTriggerIfNeeded( + anyString(), anyString(), anyInt()); + verify(mBssidBlocklistMonitor).handleBssidConnectionFailure(sBSSID, sSSID, + BssidBlocklistMonitor.REASON_EAP_FAILURE); + } + + /** * Verifies that WifiLastResortWatchdog is notified of other types of authentication failures. * @throws Exception */ |