tests: Extend the timeout for some SAE error case tests

Message ID 1534956548-8088-4-git-send-email-andrei.otcheretianski@intel.com
State New
Headers show
Series
  • tests: Extend the timeout for some SAE error case tests
Related show

Commit Message

Andrei Otcheretianski Aug. 22, 2018, 4:49 p.m.
From: Ilan Peer <ilan.peer@intel.com>

Commit 3bef4e4cbbfd ("mac80211: Adjust SAE authentication timeout") in the
kernel tree increased the SAE authentication timeout. This caused some error
case tests to fail. To fix this, extend the timeout for some error case
tests.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 tests/hwsim/test_sae.py | 4 ++--
 tests/hwsim/utils.py    | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

Patch

diff --git a/tests/hwsim/test_sae.py b/tests/hwsim/test_sae.py
index e0bc339..ba6a200 100644
--- a/tests/hwsim/test_sae.py
+++ b/tests/hwsim/test_sae.py
@@ -1059,7 +1059,7 @@  def test_sae_bignum_failure(dev, apdev):
             hapd.request("NOTE STA failure testing %d:%s" % (count, func))
             dev[0].connect("test-sae", psk="12345678", key_mgmt="SAE",
                            scan_freq="2412", wait_connect=False)
-            wait_fail_trigger(dev[0], "GET_FAIL")
+            wait_fail_trigger(dev[0], "GET_FAIL", timeout=0.1)
             dev[0].request("REMOVE_NETWORK all")
             dev[0].dump_monitor()
             hapd.dump_monitor()
@@ -1088,7 +1088,7 @@  def test_sae_bignum_failure(dev, apdev):
             hapd.request("NOTE STA failure testing %d:%s" % (count, func))
             dev[0].connect("test-sae", psk="12345678", key_mgmt="SAE",
                            scan_freq="2412", wait_connect=False)
-            wait_fail_trigger(dev[0], "GET_FAIL")
+            wait_fail_trigger(dev[0], "GET_FAIL", timeout=0.1)
             dev[0].request("REMOVE_NETWORK all")
             dev[0].dump_monitor()
             hapd.dump_monitor()
diff --git a/tests/hwsim/utils.py b/tests/hwsim/utils.py
index f19b413..c3edf8e 100644
--- a/tests/hwsim/utils.py
+++ b/tests/hwsim/utils.py
@@ -54,13 +54,14 @@  class fail_test(object):
             if self._dev.request("GET_FAIL") != "0:%s" % self._funcs:
                 raise Exception("Test failure did not trigger")
 
-def wait_fail_trigger(dev, cmd, note="Failure not triggered", max_iter=40):
+def wait_fail_trigger(dev, cmd, note="Failure not triggered", max_iter=40,
+		timeout=0.05):
     for i in range(0, max_iter):
         if dev.request(cmd).startswith("0:"):
             break
         if i == max_iter - 1:
             raise Exception(note)
-        time.sleep(0.05)
+        time.sleep(timeout)
 
 def require_under_vm():
     with open('/proc/1/cmdline', 'r') as f: