summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLiang Ma <liang.xa.ma@sony.com>2018-09-10 20:01:29 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-09-10 20:01:29 -0700
commitbc92f6b9a57983b638855c3afee9d0281b4fe4cf (patch)
tree2bb79b14070d0412a63c78e9aab057ad1fd4bea6 /tests
parenta1df98147e0a109f1600d3619093cca930588f93 (diff)
parent86e858c699629e44f268bdc7295d1e2e1c66a16e (diff)
Merge "Clear 4-way handshake state when network is removed"
am: 86e858c699 Change-Id: I4739d744bd99cf956bc7da725e2994687fb678d8
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java24
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.
*