From 161c8515ccd7da3740b564b50f00c6df43bb2832 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 28 Dec 2015 12:52:59 +0200 Subject: [PATCH] tests: Make ap_wps_probe_req_ie_oom more robust It was possible to hit a race condition between WPS_CANCEL and immediately following WPS_PIN command. Wait for a disconnection event to avoid that. This was seen with the following test case sequence: ap_wpa2_psk_supp_proto_wrong_group_key_len ap_wps_probe_req_ie_oom Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_wps.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/hwsim/test_ap_wps.py b/tests/hwsim/test_ap_wps.py index 9a6252182..c7df2b7f0 100644 --- a/tests/hwsim/test_ap_wps.py +++ b/tests/hwsim/test_ap_wps.py @@ -4931,6 +4931,7 @@ def test_ap_wps_probe_req_ie_oom(dev, apdev): if ev is None: raise Exception("Association not seen") dev[0].request("WPS_CANCEL") + dev[0].wait_disconnected() with alloc_fail(dev[0], 1, "wps_ie_encapsulate"): dev[0].request("WPS_PIN %s %s" % (apdev[0]['bssid'], pin)) @@ -4938,6 +4939,11 @@ def test_ap_wps_probe_req_ie_oom(dev, apdev): if ev is None: raise Exception("Association not seen") dev[0].request("WPS_CANCEL") + hapd.disable() + dev[0].request("REMOVE_NETWORK all") + dev[0].wait_disconnected() + time.sleep(0.2) + dev[0].flush_scan_cache() def test_ap_wps_assoc_req_ie_oom(dev, apdev): """WPS AssocReq IE OOM"""