From c63e69c3799bd7eb89c6bd4f1b0d1932b8869247 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 13 Mar 2018 01:04:03 +0200 Subject: [PATCH] tests: DPP protocol testing - stop when transmitting Auth Conf Signed-off-by: Jouni Malinen --- tests/hwsim/test_dpp.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/hwsim/test_dpp.py b/tests/hwsim/test_dpp.py index 8608d063c..e27378a14 100644 --- a/tests/hwsim/test_dpp.py +++ b/tests/hwsim/test_dpp.py @@ -3617,6 +3617,36 @@ def test_dpp_proto_stop_at_auth_conf(dev, apdev): if "result=TIMEOUT" not in ev: raise Exception("Unexpected GAS result: " + ev) +def test_dpp_proto_stop_at_auth_conf_tx(dev, apdev): + """DPP protocol testing - stop when transmitting Auth Conf (Registrar)""" + run_dpp_proto_init(dev, 1, 89, init_enrollee=True) + ev = dev[1].wait_event(["DPP-AUTH-SUCCESS"], timeout=10) + if ev is None: + raise Exception("Authentication did not succeed (Initiator)") + ev = dev[0].wait_event(["DPP-AUTH-SUCCESS"], timeout=5) + if ev is None: + raise Exception("Authentication did not succeed (Responder)") + ev = dev[1].wait_event(["GAS-QUERY-START"], timeout=0.1) + if ev is not None: + raise Exception("Unexpected GAS query") + + # There is currently no timeout on GAS server side, so no event to wait for + # in this case. + +def test_dpp_proto_stop_at_auth_conf_tx2(dev, apdev): + """DPP protocol testing - stop when transmitting Auth Conf (Enrollee)""" + run_dpp_proto_init(dev, 1, 89) + ev = dev[1].wait_event(["DPP-AUTH-SUCCESS"], timeout=10) + if ev is None: + raise Exception("Authentication did not succeed (Initiator)") + ev = dev[0].wait_event(["DPP-AUTH-SUCCESS"], timeout=5) + if ev is None: + raise Exception("Authentication did not succeed (Responder)") + + ev = dev[0].wait_event(["GAS-QUERY-DONE"], timeout=5) + if ev is None or "result=TIMEOUT" not in ev: + raise Exception("GAS query did not time out") + def test_dpp_proto_stop_at_conf_req(dev, apdev): """DPP protocol testing - stop when receiving Auth Req""" run_dpp_proto_init(dev, 1, 90)