]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Make dbus_scan_abort more robust
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 20 Sep 2017 12:37:58 +0000 (15:37 +0300)
committerJouni Malinen <j@w1.fi>
Wed, 20 Sep 2017 12:37:58 +0000 (15:37 +0300)
There was a race condition on the sequence where iface.AbortScan() is
immediately followed by iface.Scan(). If the driver event
(NL80211_CMD_SCAN_ABORTED) arrived after the following new scan request,
the D-Bus operation failed. This is not what this test case is trying to
check, so wait for an indication of the previous scan having terminated
properly before issuing the next scan.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_dbus.py

index ffc969455235340513466c9599bbe63d1867a663..03249cf030e8fd36df4a0bb75183db2e5e651be0 100644 (file)
@@ -1179,6 +1179,10 @@ def test_dbus_scan_abort(dev, apdev):
         raise Exception("Scan start timed out")
 
     iface.AbortScan()
+    ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 15)
+    if ev is None:
+        raise Exception("Scan abort result timed out")
+    dev[0].dump_monitor()
     iface.Scan({'Type': 'active', 'AllowRoam': False})
     iface.AbortScan()