From 3d5cfa0f6df6dd089c4a12caa253215894e656a1 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 13 Mar 2019 19:40:50 +0200 Subject: [PATCH] tests: Make DPP protocol failure testing more robust Wait explicitly for the DPP-NOT-COMPATIBLE event when going through protocol testing with local failures instead of just waiting for a fixed 0.1 second duration. This prevents a test failure at least in dppauth_resp_status_failure in a case where the failing operation may be delayed under heavy CPU load. Signed-off-by: Jouni Malinen --- tests/hwsim/test_dpp.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/hwsim/test_dpp.py b/tests/hwsim/test_dpp.py index 6eb7a292e..616c91e4f 100644 --- a/tests/hwsim/test_dpp.py +++ b/tests/hwsim/test_dpp.py @@ -3632,6 +3632,10 @@ def run_dpp_proto_auth_resp_missing(dev, test, reason, run_dpp_proto_init(dev, 0, test, mutual=True, incompatible_roles=incompatible_roles) if reason is None: + if incompatible_roles: + ev = dev[0].wait_event(["DPP-NOT-COMPATIBLE"], timeout=5) + if ev is None: + raise Exception("DPP-NOT-COMPATIBLE not reported") time.sleep(0.1) return ev = dev[1].wait_event(["DPP-FAIL"], timeout=5)