tests: Error handling for scan trigger failure cases
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
parent
2d9c99e37b
commit
2dc18e9a26
1 changed files with 43 additions and 0 deletions
|
@ -734,3 +734,46 @@ def _test_scan_random_mac(dev, apdev, params):
|
||||||
break
|
break
|
||||||
if not found:
|
if not found:
|
||||||
raise Exception("Fixed OUI random address not seen")
|
raise Exception("Fixed OUI random address not seen")
|
||||||
|
|
||||||
|
def test_scan_trigger_failure(dev, apdev):
|
||||||
|
"""Scan trigger to the driver failing"""
|
||||||
|
hostapd.add_ap(apdev[0]['ifname'], { "ssid": "test-scan" })
|
||||||
|
bssid = apdev[0]['bssid']
|
||||||
|
|
||||||
|
if "OK" not in dev[0].request("SET test_failure 1"):
|
||||||
|
raise Exception("Failed to set test_failure")
|
||||||
|
|
||||||
|
if "OK" not in dev[0].request("SCAN"):
|
||||||
|
raise Exception("SCAN command failed")
|
||||||
|
ev = dev[0].wait_event(["CTRL-EVENT-SCAN-FAILED"], timeout=10)
|
||||||
|
if ev is None:
|
||||||
|
raise Exception("Did not receive CTRL-EVENT-SCAN-FAILED event")
|
||||||
|
if "retry=1" in ev:
|
||||||
|
raise Exception("Unexpected scan retry indicated")
|
||||||
|
if dev[0].get_status_field('wpa_state') == "SCANNING":
|
||||||
|
raise Exception("wpa_state SCANNING not cleared")
|
||||||
|
|
||||||
|
id = dev[0].connect("test-scan", key_mgmt="NONE", scan_freq="2412",
|
||||||
|
only_add_network=True)
|
||||||
|
dev[0].select_network(id)
|
||||||
|
ev = dev[0].wait_event(["CTRL-EVENT-SCAN-FAILED"], timeout=10)
|
||||||
|
if ev is None:
|
||||||
|
raise Exception("Did not receive CTRL-EVENT-SCAN-FAILED event")
|
||||||
|
if "retry=1" not in ev:
|
||||||
|
raise Exception("No scan retry indicated for connection")
|
||||||
|
if dev[0].get_status_field('wpa_state') == "SCANNING":
|
||||||
|
raise Exception("wpa_state SCANNING not cleared")
|
||||||
|
dev[0].request("SET test_failure 0")
|
||||||
|
dev[0].wait_connected()
|
||||||
|
|
||||||
|
dev[0].request("SET test_failure 1")
|
||||||
|
if "OK" not in dev[0].request("SCAN"):
|
||||||
|
raise Exception("SCAN command failed")
|
||||||
|
ev = dev[0].wait_event(["CTRL-EVENT-SCAN-FAILED"], timeout=10)
|
||||||
|
if ev is None:
|
||||||
|
raise Exception("Did not receive CTRL-EVENT-SCAN-FAILED event")
|
||||||
|
if "retry=1" in ev:
|
||||||
|
raise Exception("Unexpected scan retry indicated")
|
||||||
|
if dev[0].get_status_field('wpa_state') != "COMPLETED":
|
||||||
|
raise Exception("wpa_state COMPLETED not restored")
|
||||||
|
dev[0].request("SET test_failure 0")
|
||||||
|
|
Loading…
Reference in a new issue