summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLiang Ma <liang.xa.ma@sony.com>2018-09-10 20:21:05 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-09-10 20:21:05 -0700
commit3c7d24f7c5d523f12e8b26b23511cda44ff40d10 (patch)
treecc77832c8c6dca1308e73a72d54d121121ca6f65 /tests
parent260b4dd50a4e670d74c6916ae3d8d564e09b7f90 (diff)
parent3ed7278636a6c7abaa29a391dcded48e7a413b3f (diff)
Merge "Clear 4-way handshake state when network is removed" am: 86e858c699 am: bc92f6b9a5
am: 3ed7278636 Change-Id: I59619a753a39067e9296f009cf6ef8ef844d08d8
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 3cf1c9ef9..ba1c93da3 100644
--- a/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/SupplicantStaIfaceHalTest.java
@@ -1215,6 +1215,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.
*