From edac8087e663db58fe830d2c66bfc7ea3c9438de Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 30 Nov 2017 12:56:24 +0200 Subject: [PATCH] tests: Make dpp_auth_req_retries* more reliable These test cases were failing when run immediately after dpp_pkex_test_fail. It looks like timing of the TX status and the short eloop wait were getting reordered in this cases. This ended up with some of the DPP-TX-STATUS event messages missing. Instead of explicitly checking for those message, simply count the number of DPP-TX messages to verify that the correct number of retries are being sent. Signed-off-by: Jouni Malinen --- tests/hwsim/test_dpp.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tests/hwsim/test_dpp.py b/tests/hwsim/test_dpp.py index 1b689d684..c40ae83c5 100644 --- a/tests/hwsim/test_dpp.py +++ b/tests/hwsim/test_dpp.py @@ -2737,12 +2737,9 @@ def test_dpp_auth_req_retries(dev, apdev): run_dpp_proto_init(dev, 1, 1, unicast=False, listen=False) for i in range(3): - ev = dev[1].wait_event(["DPP-TX"], timeout=5) + ev = dev[1].wait_event(["DPP-TX "], timeout=5) if ev is None: raise Exception("Auth Req not sent (%d)" % i) - ev = dev[1].wait_event(["DPP-TX-STATUS"], timeout=5) - if ev is None: - raise Exception("Auth Req TX status not seen (%d)" % i) ev = dev[1].wait_event(["DPP-AUTH-INIT-FAILED"], timeout=5) if ev is None: @@ -2758,12 +2755,9 @@ def test_dpp_auth_req_retries_multi_chan(dev, apdev): chan="81/1,81/6,81/11") for i in range(3 * 3): - ev = dev[1].wait_event(["DPP-TX"], timeout=5) + ev = dev[1].wait_event(["DPP-TX "], timeout=5) if ev is None: raise Exception("Auth Req not sent (%d)" % i) - ev = dev[1].wait_event(["DPP-TX-STATUS"], timeout=5) - if ev is None: - raise Exception("Auth Req TX status not seen (%d)" % i) ev = dev[1].wait_event(["DPP-AUTH-INIT-FAILED"], timeout=5) if ev is None: