aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2017-01-07 16:46:57 (GMT)
committerJouni Malinen <j@w1.fi>2017-01-07 16:46:57 (GMT)
commit18d1b41b5c92dfb43c1ded17335e777d9c3e3070 (patch)
tree91961fb36579ca6d13a144acc843f86d658d0a9e /tests
parente4ec6bbfd82dd29daabac8c2db84e4f9540edc67 (diff)
downloadhostap-18d1b41b5c92dfb43c1ded17335e777d9c3e3070.zip
hostap-18d1b41b5c92dfb43c1ded17335e777d9c3e3070.tar.gz
hostap-18d1b41b5c92dfb43c1ded17335e777d9c3e3070.tar.bz2
tests: Radio measurement request - link measurement
Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_rrm.py48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/hwsim/test_rrm.py b/tests/hwsim/test_rrm.py
index 5b6e83a..5a8deb3 100644
--- a/tests/hwsim/test_rrm.py
+++ b/tests/hwsim/test_rrm.py
@@ -1535,3 +1535,51 @@ def test_rrm_req_proto(dev, apdev):
hapd.set("ext_mgmt_frame_handling", "0")
dev[0].request("SET ext_mgmt_frame_handling 0")
dev[0].request("SET LCI ")
+
+def test_rrm_link_measurement(dev, apdev):
+ """Radio measurement request - link measurement"""
+ params = { "ssid": "rrm", "rrm_beacon_report": "1" }
+ hapd = hostapd.add_ap(apdev[0]['ifname'], params)
+ bssid = hapd.own_addr()
+
+ dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412")
+ addr = dev[0].own_addr()
+
+ hdr = "d0003a01" + addr.replace(':', '') + 2*bssid.replace(':', '') + "1000"
+
+ hapd.set("ext_mgmt_frame_handling", "1")
+ dev[0].request("SET ext_mgmt_frame_handling 1")
+
+ if "OK" not in dev[0].request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + hdr + "0502000000"):
+ raise Exception("MGMT_RX_PROCESS failed")
+ ev = hapd.wait_event(["MGMT-RX"], timeout=5)
+ if ev is None:
+ raise Exception("No link measurement report seen")
+
+def test_rrm_link_measurement_oom(dev, apdev):
+ """Radio measurement request - link measurement OOM"""
+ params = { "ssid": "rrm", "rrm_beacon_report": "1" }
+ hapd = hostapd.add_ap(apdev[0]['ifname'], params)
+ bssid = hapd.own_addr()
+
+ dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412")
+ addr = dev[0].own_addr()
+
+ hdr = "d0003a01" + addr.replace(':', '') + 2*bssid.replace(':', '') + "1000"
+
+ hapd.set("ext_mgmt_frame_handling", "1")
+ dev[0].request("SET ext_mgmt_frame_handling 1")
+
+ with alloc_fail(dev[0], 1, "wpabuf_alloc;wpas_rrm_handle_link_measurement_request"):
+ if "OK" not in dev[0].request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + hdr + "0502000000"):
+ raise Exception("MGMT_RX_PROCESS failed")
+ wait_fail_trigger(dev[0], "GET_ALLOC_FAIL")
+
+ with fail_test(dev[0], 1, "wpas_rrm_handle_link_measurement_request"):
+ if "OK" not in dev[0].request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + hdr + "0502000000"):
+ raise Exception("MGMT_RX_PROCESS failed")
+ wait_fail_trigger(dev[0], "GET_FAIL")
+
+ ev = hapd.wait_event(["MGMT-RX"], timeout=0.1)
+ if ev is not None:
+ raise Exception("Unexpected beacon report response during OOM")