From 584e4197bd12d91d3b3ee69844b381ee3b7c4769 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 17 Jan 2015 16:59:40 +0200 Subject: [PATCH] tests: Make ap_wpa2_eap_aka_ext faster and more robust Use SELECT_NETWORK instead of REASSOCIATE for the first reconnection to avoid unnecessary long wait for temporary network disabling to be cleared. In addition, wait for the disconnect event after issuing the DISCONNECT commands to avoid issues due to any pending events during the immediately following reconnection attempt. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_eap.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_ap_eap.py b/tests/hwsim/test_ap_eap.py index accc134ff..6293e7a04 100644 --- a/tests/hwsim/test_ap_eap.py +++ b/tests/hwsim/test_ap_eap.py @@ -558,8 +558,9 @@ def _test_ap_wpa2_eap_aka_ext(dev, apdev): if ev is None: raise Exception("EAP failure not reported") dev[0].request("DISCONNECT") + dev[0].wait_disconnected() - dev[0].request("REASSOCIATE") + dev[0].select_network(id, freq="2412") ev = dev[0].wait_event(["CTRL-REQ-SIM"], timeout=15) if ev is None: raise Exception("Wait for external SIM processing request timed out") @@ -574,6 +575,7 @@ def _test_ap_wpa2_eap_aka_ext(dev, apdev): if ev is None: raise Exception("EAP failure not reported") dev[0].request("DISCONNECT") + dev[0].wait_disconnected() dev[0].select_network(id, freq="2412") ev = dev[0].wait_event(["CTRL-REQ-SIM"], timeout=15) @@ -600,6 +602,7 @@ def _test_ap_wpa2_eap_aka_ext(dev, apdev): if ev is None: raise Exception("EAP failure not reported") dev[0].request("DISCONNECT") + dev[0].wait_disconnected() dev[0].select_network(id, freq="2412") ev = dev[0].wait_event(["CTRL-REQ-SIM"], timeout=15) @@ -616,6 +619,7 @@ def _test_ap_wpa2_eap_aka_ext(dev, apdev): if ev is None: raise Exception("EAP failure not reported") dev[0].request("DISCONNECT") + dev[0].wait_disconnected() dev[0].select_network(id, freq="2412") ev = dev[0].wait_event(["CTRL-REQ-SIM"], timeout=15) @@ -632,6 +636,7 @@ def _test_ap_wpa2_eap_aka_ext(dev, apdev): if ev is None: raise Exception("EAP failure not reported") dev[0].request("DISCONNECT") + dev[0].wait_disconnected() dev[0].select_network(id, freq="2412") ev = dev[0].wait_event(["CTRL-REQ-SIM"], timeout=15) @@ -648,6 +653,7 @@ def _test_ap_wpa2_eap_aka_ext(dev, apdev): if ev is None: raise Exception("EAP failure not reported") dev[0].request("DISCONNECT") + dev[0].wait_disconnected() dev[0].select_network(id, freq="2412") ev = dev[0].wait_event(["CTRL-REQ-SIM"], timeout=15) @@ -664,6 +670,7 @@ def _test_ap_wpa2_eap_aka_ext(dev, apdev): if ev is None: raise Exception("EAP failure not reported") dev[0].request("DISCONNECT") + dev[0].wait_disconnected() dev[0].select_network(id, freq="2412") ev = dev[0].wait_event(["CTRL-REQ-SIM"], timeout=15) @@ -680,6 +687,7 @@ def _test_ap_wpa2_eap_aka_ext(dev, apdev): if ev is None: raise Exception("EAP failure not reported") dev[0].request("DISCONNECT") + dev[0].wait_disconnected() dev[0].select_network(id, freq="2412") ev = dev[0].wait_event(["CTRL-REQ-SIM"], timeout=15) @@ -695,6 +703,8 @@ def _test_ap_wpa2_eap_aka_ext(dev, apdev): ev = dev[0].wait_event(["CTRL-EVENT-EAP-FAILURE"], timeout=15) if ev is None: raise Exception("EAP failure not reported") + dev[0].request("DISCONNECT") + dev[0].wait_disconnected() def test_ap_wpa2_eap_aka_prime(dev, apdev): """WPA2-Enterprise connection using EAP-AKA'"""