]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make dpp_pkex_test_fail and dpp_pkex_alloc_fail more robust
authorJouni Malinen <j@w1.fi>
Mon, 25 Dec 2017 16:36:17 +0000 (18:36 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 25 Dec 2017 16:36:17 +0000 (18:36 +0200)
Wait for test/allocation failure for longer than the wait_fail_trigger()
default two seconds to allow DPP (in particular, PKEX) retransmission to
occur. This removes some issues where the previous wait was more or less
exactly the same duration as the retransmission interval and the first
Listen operation not always starting quickly enough to receive the first
frame.

Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_dpp.py

index 748331a2449b1771c308241bdc4512d6bcccefb8..3a75e61bd1f4d0a12124b7c9fdd7c2b7d7d76967 100644 (file)
@@ -3877,7 +3877,7 @@ def test_dpp_pkex_alloc_fail(dev, apdev):
         with alloc_fail(dev[1], count, func):
             cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 conf=sta-dpp configurator=%d code=secret" % (id1, conf_id)
             dev[1].request(cmd)
-            wait_fail_trigger(dev[1], "GET_ALLOC_FAIL")
+            wait_fail_trigger(dev[1], "GET_ALLOC_FAIL", max_iter=100)
             ev = dev[0].wait_event(["GAS-QUERY-START"], timeout=0.01)
             if ev:
                 dev[0].request("DPP_STOP_LISTEN")
@@ -3931,7 +3931,7 @@ def test_dpp_pkex_alloc_fail(dev, apdev):
         with alloc_fail(dev[0], count, func):
             cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 conf=sta-dpp configurator=%d code=secret" % (id1, conf_id)
             dev[1].request(cmd)
-            wait_fail_trigger(dev[0], "GET_ALLOC_FAIL")
+            wait_fail_trigger(dev[0], "GET_ALLOC_FAIL", max_iter=100)
             ev = dev[0].wait_event(["GAS-QUERY-START"], timeout=0.01)
             if ev:
                 dev[0].request("DPP_STOP_LISTEN")
@@ -4011,7 +4011,7 @@ def test_dpp_pkex_test_fail(dev, apdev):
         with fail_test(dev[1], count, func):
             cmd = "DPP_PKEX_ADD own=%d identifier=test init=1 conf=sta-dpp configurator=%d code=secret" % (id1, conf_id)
             dev[1].request(cmd)
-            wait_fail_trigger(dev[1], "GET_FAIL")
+            wait_fail_trigger(dev[1], "GET_FAIL", max_iter=100)
             ev = dev[0].wait_event(["GAS-QUERY-START"], timeout=0.01)
             if ev:
                 dev[0].request("DPP_STOP_LISTEN")