]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Scan failures for TYPE=ONLY
authorJouni Malinen <jouni@qca.qualcomm.com>
Wed, 1 Mar 2017 14:42:56 +0000 (16:42 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 1 Mar 2017 14:42:56 +0000 (16:42 +0200)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_scan.py

index 48934244e7c153eb98c0bf4ccc95aff409d5ac21..c4ec722e46c750f9214ec2fe1a150743871d7c70 100644 (file)
@@ -1141,6 +1141,18 @@ def test_scan_fail(dev, apdev):
     with alloc_fail(dev[0], 1, "wpa_bss_add"):
         dev[0].scan_for_bss(apdev[0]['bssid'], freq="2412")
 
+def test_scan_fail_type_only(dev, apdev):
+    """Scan failures for TYPE=ONLY"""
+    with fail_test(dev[0], 1, "wpa_driver_nl80211_scan"):
+        dev[0].request("SCAN TYPE=ONLY freq=2417")
+        ev = dev[0].wait_event(["CTRL-EVENT-SCAN-FAILED"], timeout=5)
+        if ev is None:
+            raise Exception("Scan trigger failure not reported")
+    # Verify that scan_only_handler() does not get left set as the
+    # wpa_s->scan_res_handler in failure case.
+    hapd = hostapd.add_ap(apdev[0], { "ssid": "open" })
+    dev[0].connect("open", key_mgmt="NONE", scan_freq="2412")
+
 @remote_compatible
 def test_scan_freq_list(dev, apdev):
     """Scan with SET freq_list and scan_cur_freq"""