]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: wpa_supplicant ctrl_iface NEIGHBOR_REP_REQUEST OOM
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 3 Jan 2017 15:17:58 +0000 (17:17 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 3 Jan 2017 17:53:03 +0000 (19:53 +0200)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_rrm.py

index 2d871b9379a3d238cc1c1e203b01023b96b2ec0d..c4be69ff759db93e80b3669c7c30357479ac9583 100644 (file)
@@ -329,6 +329,35 @@ def test_rrm_neighbor_rep_req_timeout(dev, apdev):
         raise Exception("Neighbor report request not seen")
     check_nr_results(dev[0])
 
+def test_rrm_neighbor_rep_req_oom(dev, apdev):
+    """wpa_supplicant ctrl_iface NEIGHBOR_REP_REQUEST OOM"""
+    params = { "ssid": "test2", "rrm_neighbor_report": "1",
+               "stationary_ap": "1", "lci": lci, "civic": civic }
+    hapd = hostapd.add_ap(apdev[0]['ifname'], params)
+
+    bssid = apdev[0]['bssid']
+
+    rrm = int(dev[0].get_driver_status_field("capa.rrm_flags"), 16)
+    if rrm & 0x5 != 0x5 and rrm & 0x10 != 0x10:
+        raise HwsimSkip("Required RRM capabilities are not supported")
+
+    dev[0].connect("test2", key_mgmt="NONE", scan_freq="2412")
+
+    with alloc_fail(dev[0], 1, "wpabuf_alloc;wpas_rrm_process_neighbor_rep"):
+        if "OK" not in dev[0].request("NEIGHBOR_REP_REQUEST"):
+            raise Exception("Request failed")
+        wait_fail_trigger(dev[0], "GET_ALLOC_FAIL")
+
+    with fail_test(dev[0], 1,
+                    "wpa_driver_nl80211_send_action;wpas_rrm_send_neighbor_rep_request"):
+        if "FAIL" not in dev[0].request("NEIGHBOR_REP_REQUEST"):
+            raise Exception("Request succeeded unexpectedly")
+
+    with alloc_fail(dev[0], 1,
+                    "wpabuf_alloc;wpas_rrm_send_neighbor_rep_request"):
+        if "FAIL" not in dev[0].request("NEIGHBOR_REP_REQUEST"):
+            raise Exception("Request succeeded unexpectedly")
+
 def test_rrm_ftm_range_req(dev, apdev):
     """hostapd FTM range request command"""