aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2016-05-28 19:01:32 (GMT)
committerJouni Malinen <j@w1.fi>2016-05-28 19:47:31 (GMT)
commit0b0e4792d3c60aab499c0ceff2f3ce5e3f2205ed (patch)
tree1f46db04bc4b6cd3e2152711f465a1cd6e8d62e6 /tests
parentf37d8a4da496a9a12fb0ff2b8de6a39130d8fa1f (diff)
downloadhostap-0b0e4792d3c60aab499c0ceff2f3ce5e3f2205ed.zip
hostap-0b0e4792d3c60aab499c0ceff2f3ce5e3f2205ed.tar.gz
hostap-0b0e4792d3c60aab499c0ceff2f3ce5e3f2205ed.tar.bz2
tests: Increase scan_fail coverage
Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_scan.py28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/hwsim/test_scan.py b/tests/hwsim/test_scan.py
index 5737f4b..9a7e6b1 100644
--- a/tests/hwsim/test_scan.py
+++ b/tests/hwsim/test_scan.py
@@ -1014,6 +1014,16 @@ def test_scan_fail(dev, apdev):
raise Exception("Did not see scan failure event")
dev[0].dump_monitor()
+ for i in range(1, 5):
+ with alloc_fail(dev[0], i,
+ "wpa_scan_clone_params;wpa_supplicant_trigger_scan"):
+ if "OK" not in dev[0].request("SCAN ssid 112233 freq=2412"):
+ raise Exception("SCAN failed")
+ ev = dev[0].wait_event(["CTRL-EVENT-SCAN-FAILED"], timeout=5)
+ if ev is None:
+ raise Exception("Did not see scan failure event")
+ dev[0].dump_monitor()
+
with alloc_fail(dev[0], 1, "radio_add_work;wpa_supplicant_trigger_scan"):
if "OK" not in dev[0].request("SCAN freq=2412"):
raise Exception("SCAN failed")
@@ -1049,6 +1059,24 @@ def test_scan_fail(dev, apdev):
wait_fail_trigger(dev[0], "GET_ALLOC_FAIL")
dev[0].dump_monitor()
+ try:
+ if "OK" not in dev[0].request("SET setband 2G"):
+ raise Exception("SET setband failed")
+ with alloc_fail(dev[0], 1, "=wpa_setband_scan_freqs_list"):
+ # While the frequency list cannot be created due to memory
+ # allocation failure, this scan is expected to be completed without
+ # frequency filtering.
+ if "OK" not in dev[0].request("SCAN"):
+ raise Exception("SCAN failed")
+ wait_fail_trigger(dev[0], "GET_ALLOC_FAIL")
+ dev[0].request("ABORT_SCAN")
+ ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"])
+ if ev is None:
+ raise Exception("Scan did not complete")
+ finally:
+ dev[0].request("SET setband AUTO")
+ dev[0].dump_monitor()
+
wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
wpas.interface_add("wlan5")
wpas.request("SET preassoc_mac_addr 1")