]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make ap_wpa2_eap_peap_params more robust
authorJouni Malinen <jouni@codeaurora.org>
Fri, 15 Mar 2019 11:49:25 +0000 (13:49 +0200)
committerJouni Malinen <j@w1.fi>
Fri, 15 Mar 2019 11:51:55 +0000 (13:51 +0200)
One of the steps that expected failure due to PMKID mismatch did not
stop connection attempts. This could result in the following test step
failing due to the previous profile with peaplabel=1 getting used to
derive the MSK incorrectly.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_ap_eap.py

index a509d1160d9708fbe084668be9a63f3496f191bf..64cb267111d52a71bd6d0e2beb99f31f39ea00d5 100644 (file)
@@ -2029,9 +2029,12 @@ def test_ap_wpa2_eap_peap_params(dev, apdev):
     ev = dev[0].wait_event(["CTRL-EVENT-EAP-SUCCESS"], timeout=15)
     if ev is None:
         raise Exception("No EAP success seen")
-    ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=1)
-    if ev is not None:
+    ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED",
+                            "CTRL-EVENT-DISCONNECTED"], timeout=1)
+    if ev and "CTRL-EVENT-CONNECTED" in ev:
         raise Exception("Unexpected connection")
+    dev[0].request("REMOVE_NETWORK all")
+    dev[0].request("ABORT_SCAN")
 
     tests = [ ("peap-ver0", ""),
               ("peap-ver1", ""),