tests: Make dbus_scan_abort more robust

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>
This commit is contained in:
Jouni Malinen 2017-09-20 15:37:58 +03:00 committed by Jouni Malinen
parent 3de1566db8
commit f41f04d04c

View 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()