tests: Make WNM test case scan clearing more robust
There was a race condition on starting the flush_scan_cache() operations if a scan happened to be in progress when the test case ended since the ABORT_SCAN success case did not wait for the pending scan operation to be completed. Wait for the scan completion event in addition to the disconnection event if the ABORT_SCAN command is accepted. Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
673631b8a3
commit
86db4e63d3
1 changed files with 11 additions and 5 deletions
|
@ -28,8 +28,10 @@ def clear_regdom_state(dev, hapd, hapd2):
|
||||||
if hapd2:
|
if hapd2:
|
||||||
hapd2.request("DISABLE")
|
hapd2.request("DISABLE")
|
||||||
dev[0].request("DISCONNECT")
|
dev[0].request("DISCONNECT")
|
||||||
dev[0].request("ABORT_SCAN")
|
res = dev[0].request("ABORT_SCAN")
|
||||||
dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=0.5)
|
for i in range(2 if "OK" in res else 1):
|
||||||
|
dev[0].wait_event(["CTRL-EVENT-DISCONNECTED",
|
||||||
|
"CTRL-EVENT-SCAN-RESULTS"], timeout=0.5)
|
||||||
dev[0].dump_monitor()
|
dev[0].dump_monitor()
|
||||||
subprocess.call(['iw', 'reg', 'set', '00'])
|
subprocess.call(['iw', 'reg', 'set', '00'])
|
||||||
dev[0].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=0.5)
|
dev[0].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=0.5)
|
||||||
|
@ -1136,11 +1138,13 @@ def stop_wnm_tm(hapd, dev):
|
||||||
hapd.request("DISABLE")
|
hapd.request("DISABLE")
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
dev[0].request("DISCONNECT")
|
dev[0].request("DISCONNECT")
|
||||||
dev[0].request("ABORT_SCAN")
|
res = dev[0].request("ABORT_SCAN")
|
||||||
try:
|
try:
|
||||||
dev[0].wait_disconnected()
|
dev[0].wait_disconnected()
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
if "OK" in res:
|
||||||
|
dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], timeout=0.5)
|
||||||
subprocess.call(['iw', 'reg', 'set', '00'])
|
subprocess.call(['iw', 'reg', 'set', '00'])
|
||||||
wait_regdom_changes(dev[0])
|
wait_regdom_changes(dev[0])
|
||||||
country = dev[0].get_driver_status_field("country")
|
country = dev[0].get_driver_status_field("country")
|
||||||
|
@ -1881,8 +1885,10 @@ def test_wnm_bss_tm_reject(dev, apdev):
|
||||||
if hapd:
|
if hapd:
|
||||||
hapd.request("DISABLE")
|
hapd.request("DISABLE")
|
||||||
dev[0].request("DISCONNECT")
|
dev[0].request("DISCONNECT")
|
||||||
dev[0].request("ABORT_SCAN")
|
res = dev[0].request("ABORT_SCAN")
|
||||||
dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=0.5)
|
for i in range(2 if "OK" in res else 1):
|
||||||
|
dev[0].wait_event(["CTRL-EVENT-DISCONNECTED",
|
||||||
|
"CTRL-EVENT-SCAN-RESULTS"], timeout=0.5)
|
||||||
subprocess.call(['iw', 'reg', 'set', '00'])
|
subprocess.call(['iw', 'reg', 'set', '00'])
|
||||||
dev[0].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=0.5)
|
dev[0].wait_event(["CTRL-EVENT-REGDOM-CHANGE"], timeout=0.5)
|
||||||
dev[0].flush_scan_cache()
|
dev[0].flush_scan_cache()
|
||||||
|
|
Loading…
Add table
Reference in a new issue