From: Jouni Malinen Date: Fri, 15 Mar 2019 11:49:25 +0000 (+0200) Subject: tests: Make ap_wpa2_eap_peap_params more robust X-Git-Tag: hostap_2_8~209 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cfc758827a9e53abe8a1409cdedcb45376b690f;p=thirdparty%2Fhostap.git tests: Make ap_wpa2_eap_peap_params more robust 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 --- diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index a509d1160..64cb26711 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -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", ""),