]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make scan_bss_expiration_count more robust with UML
authorJouni Malinen <jouni@codeaurora.org>
Thu, 1 Aug 2019 12:44:22 +0000 (15:44 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 1 Aug 2019 12:44:22 +0000 (15:44 +0300)
Test case sequence "persistent_group_channel scan_bss_expiration_count"
was failing with UML when using time travel. This seemed to be because
there was no explicit wait to confirm that the AP has been fully
disabled before running the next scan. Work around this by verifying
that hostapd has terminated the BSS and waiting a bit after that before
proceeding.

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_scan.py

index 220ce2b12a59a3790fee76a2715388162de1284a..0b302d5049a4d9a67013c699f74833cd5cb6941a 100644 (file)
@@ -162,6 +162,11 @@ def test_scan_bss_expiration_count(dev, apdev):
     if bssid not in dev[0].request("SCAN_RESULTS"):
         raise Exception("BSS not found in initial scan")
     hapd.request("DISABLE")
+    # Try to give enough time for hostapd to have stopped mac80211 from
+    # beaconing before checking a new scan. This is needed with UML time travel
+    # testing.
+    hapd.ping()
+    time.sleep(0.2)
     dev[0].scan(freq="2412", only_new=True)
     if bssid not in dev[0].request("SCAN_RESULTS"):
         raise Exception("BSS not found in first scan without match")