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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2019-05-27 22:22:07 +03:00
parent d55035c935
commit f19c56e383

View file

@ -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,6 +6584,7 @@ def test_ap_wpa2_eap_status(dev, apdev):
logger.info("selectedMethods: " + str(selected_methods))
if not success:
raise Exception("EAP did not succeed")
if not connected:
dev[0].wait_connected()
dev[0].request("REMOVE_NETWORK all")
dev[0].wait_disconnected()