From 5a5529c9f430a0fc5f25290e73e8476b7106e7f8 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 1 Jan 2019 16:17:13 +0200 Subject: [PATCH] tests: Make dpp_pkex_no_responder handle enabled 5 GHz channels It was possible for the 5 GHz PKEX channels to be enabled, e.g., when running "ap_ht40_csa2 dpp_pkex_no_responder" test sequence, and that resulted in a failure in dpp_pkex_no_responder due to the unexpectedly long wait needed for the DPP-FAIL event. Increase the wait time to allow for 5 GHz PKEX channels to be probed. Signed-off-by: Jouni Malinen --- tests/hwsim/test_dpp.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/hwsim/test_dpp.py b/tests/hwsim/test_dpp.py index a59e05b3d..c02b17fad 100644 --- a/tests/hwsim/test_dpp.py +++ b/tests/hwsim/test_dpp.py @@ -3262,11 +3262,15 @@ def test_dpp_pkex_no_responder(dev, apdev): if "FAIL" in res: raise Exception("Failed to set PKEX data (initiator)") - ev = dev[0].wait_event(["DPP-FAIL"], timeout=15) - if ev is None: - raise Exception("DPP PKEX failure not reported") - if "No response from PKEX peer" not in ev: - raise Exception("Unexpected failure reason: " + ev) + for i in range(15): + ev = dev[0].wait_event(["DPP-TX ", "DPP-FAIL"], timeout=5) + if ev is None: + raise Exception("DPP PKEX failure not reported") + if "DPP-FAIL" not in ev: + continue + if "No response from PKEX peer" not in ev: + raise Exception("Unexpected failure reason: " + ev) + break def test_dpp_pkex_after_retry(dev, apdev): """DPP and PKEX completing after retry"""