diff options
author | Liang Ma <liang.xa.ma@sony.com> | 2018-09-10 20:10:55 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-09-10 20:10:55 -0700 |
commit | 3ed7278636a6c7abaa29a391dcded48e7a413b3f (patch) | |
tree | b4cc0b39cef14552ca1e08a1c8aa6821be21bb31 /tests | |
parent | b12f48bf47d8365f0848fc72245f3726e8481ebc (diff) | |
parent | bc92f6b9a57983b638855c3afee9d0281b4fe4cf (diff) |
Merge "Clear 4-way handshake state when network is removed" am: 86e858c699
am: bc92f6b9a5
Change-Id: I4fad7b8eff1d893ca3510c07fea4a864549b6be2
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java b/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java index b4ea5af34..eded7fc17 100644 --- a/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java +++ b/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java @@ -1201,6 +1201,30 @@ public class SupplicantStaIfaceHalTest { eq(WifiManager.ERROR_AUTH_FAILURE_WRONG_PSWD), eq(-1)); } + /** + * Tests the handling of incorrect network passwords, edge case. + * + * If the network is removed during 4-way handshake, do not call it a password mismatch. + */ + @Test + public void testNetworkRemovedDuring4way() throws Exception { + executeAndValidateInitializationSequence(); + assertNotNull(mISupplicantStaIfaceCallback); + + int reasonCode = 3; + + mISupplicantStaIfaceCallback.onStateChanged( + ISupplicantStaIfaceCallback.State.FOURWAY_HANDSHAKE, + NativeUtil.macAddressToByteArray(BSSID), + SUPPLICANT_NETWORK_ID, + NativeUtil.decodeSsid(SUPPLICANT_SSID)); + mISupplicantStaIfaceCallback.onNetworkRemoved(SUPPLICANT_NETWORK_ID); + mISupplicantStaIfaceCallback.onDisconnected( + NativeUtil.macAddressToByteArray(BSSID), true, reasonCode); + verify(mWifiMonitor, times(0)).broadcastAuthenticationFailureEvent(any(), anyInt(), + anyInt()); + } + /** * Tests the handling of incorrect network passwords, edge case. * |