]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Fix Python sleep function
authorMarkus Theil <markus.theil@tu-ilmenau.de>
Wed, 8 Jan 2020 23:03:02 +0000 (00:03 +0100)
committerJouni Malinen <j@w1.fi>
Thu, 9 Jan 2020 09:55:53 +0000 (11:55 +0200)
Current Python versions have no os.sleep(), use time.sleep() instead.

module 'os' has no attribute 'sleep'
Traceback (most recent call last):
  File "./run-tests.py", line 521, in main
    t(dev, apdev)
  File "/home/mtheil/hostap/tests/hwsim/test_pmksa_cache.py", line 356, in test_pmksa_cache_expiration
    hapd.wait_ptkinitdone(dev[0].own_addr())
  File "/home/mtheil/hostap/tests/hwsim/hostapd.py", line 282, in wait_ptkinitdone
    os.sleep(0.1)

Signed-off-by: Markus Theil <markus.theil@tu-ilmenau.de>
tests/hwsim/hostapd.py

index b4ebbdbf68e4e99b9804d5dee1bfde8c1e24ecd1..67e8a7fb8cdcfe2721d49036d29c828a59d5111b 100644 (file)
@@ -279,7 +279,7 @@ class Hostapd:
             state = sta['hostapdWPAPTKState']
             if state == "11":
                 return
-            os.sleep(0.1)
+            time.sleep(0.1)
             timeout -= 0.1
         raise Exception("Timeout while waiting for PTKINITDONE")