From f19c56e38371ae42adbfbca8c6a2a36c72b5c1e7 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 27 May 2019 22:22:07 +0300 Subject: [PATCH] tests: Fix ap_wpa2_eap_status loop with UML time-travel=inf-cpu Busy loop for waiting is not going to work with time-travel=inf-cpu, so need to something a bit more explicit to wait for the wpa_supplicant process to proceed while not fully breaking the idea of this test case to iteration through large number of STATUS-VERBOSE commands to hit different states. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_eap.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index 887faf0f5..911baf61e 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -6545,7 +6545,12 @@ def test_ap_wpa2_eap_status(dev, apdev): decisions = [] req_methods = [] selected_methods = [] + connected = False for i in range(100000): + if not connected and i % 10 == 9: + ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=0.0001) + if ev: + connected = True s = dev[0].get_status(extra="VERBOSE") if 'EAP state' in s: state = s['EAP state'] @@ -6579,7 +6584,8 @@ def test_ap_wpa2_eap_status(dev, apdev): logger.info("selectedMethods: " + str(selected_methods)) if not success: raise Exception("EAP did not succeed") - dev[0].wait_connected() + if not connected: + dev[0].wait_connected() dev[0].request("REMOVE_NETWORK all") dev[0].wait_disconnected()