From 8cfc758827a9e53abe8a1409cdedcb45376b690f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 15 Mar 2019 13:49:25 +0200 Subject: [PATCH] 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 --- tests/hwsim/test_ap_eap.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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", ""),