|
@@ -1035,3 +1035,100 @@ def test_rrm_beacon_req_active_duration_mandatory(dev, apdev):
|
|
|
raise Exception("Unexpected Measurement Report Mode: " + fields[3])
|
|
|
if len(fields[4]) > 0:
|
|
|
raise Exception("Unexpected beacon report received")
|
|
|
+
|
|
|
+def test_rrm_req_proto(dev, apdev):
|
|
|
+ """Radio measurement request - protocol testing"""
|
|
|
+ params = { "ssid": "rrm", "rrm_beacon_report": "1" }
|
|
|
+ hapd = hostapd.add_ap(apdev[0]['ifname'], params)
|
|
|
+ bssid = hapd.own_addr()
|
|
|
+
|
|
|
+ dev[0].request("SET LCI ")
|
|
|
+ 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")
|
|
|
+
|
|
|
+ tests = []
|
|
|
+
|
|
|
+ tests += [ "0500", "050001", "05000100" ]
|
|
|
+
|
|
|
+ tests += [ "0500010000" ]
|
|
|
+
|
|
|
+ tests += [ "050001000026" ]
|
|
|
+
|
|
|
+ tests += [ "05000100002600", "0500010000260111", "050001000026021122" ]
|
|
|
+
|
|
|
+ tests += [ "05000100002603", "0500010000260311", "050001000026031122" ]
|
|
|
+
|
|
|
+ tests += [ "05000100002603010200" ]
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ tests += [ "0502" ]
|
|
|
+
|
|
|
+ tests += [ "05000100002603010008" ]
|
|
|
+
|
|
|
+ tests += [ "0505" ]
|
|
|
+
|
|
|
+ tests += [ "050500", "050501", "050502", "050503", "050504", "050505" ]
|
|
|
+
|
|
|
+ tests += [ "05000100002603010005",
|
|
|
+ "0500010000260f010005112233445566778899aabbcc" ]
|
|
|
+
|
|
|
+ tests += [ "05000100002610010005112233445566778899aabbccdd" ]
|
|
|
+
|
|
|
+ tests += [ "05000100002614010005112233445566008899aabbccdd01020000" ]
|
|
|
+
|
|
|
+ tests += [ "05000100000000" ]
|
|
|
+ for t in tests:
|
|
|
+ if "OK" not in dev[0].request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + hdr + t):
|
|
|
+ raise Exception("MGMT_RX_PROCESS failed")
|
|
|
+ ev = hapd.wait_event(["MGMT-RX"], timeout=0.2)
|
|
|
+ if ev is not None:
|
|
|
+ raise Exception("Unexpected response seen at the AP: " + ev)
|
|
|
+
|
|
|
+ tests = []
|
|
|
+
|
|
|
+ tests += [ "05000100002603010105" ]
|
|
|
+
|
|
|
+ tests += [ "050001000026030100fe" ]
|
|
|
+
|
|
|
+ tests += [ "0500010000260701000811223344" ]
|
|
|
+ for t in tests:
|
|
|
+ if "OK" not in dev[0].request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + hdr + t):
|
|
|
+ raise Exception("MGMT_RX_PROCESS failed")
|
|
|
+ ev = hapd.wait_event(["MGMT-RX"], timeout=5)
|
|
|
+ if ev is None:
|
|
|
+ raise Exception("No response seen at the AP")
|
|
|
+ hapd.dump_monitor()
|
|
|
+
|
|
|
+ dev[0].request("SET LCI " + lci)
|
|
|
+ tests = []
|
|
|
+
|
|
|
+ tests += [ "0500010000260701000811223344" ]
|
|
|
+ for t in tests:
|
|
|
+ if "OK" not in dev[0].request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + hdr + t):
|
|
|
+ raise Exception("MGMT_RX_PROCESS failed")
|
|
|
+ ev = hapd.wait_event(["MGMT-RX"], timeout=0.2)
|
|
|
+ if ev is not None:
|
|
|
+ raise Exception("Unexpected response seen at the AP: " + ev)
|
|
|
+
|
|
|
+ tests = []
|
|
|
+
|
|
|
+ tests += [ "0500010000260701000801223344",
|
|
|
+ "05000100002607010008010402ff",
|
|
|
+ "05000100002608010008010402ffff" ]
|
|
|
+ for t in tests:
|
|
|
+ if "OK" not in dev[0].request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + hdr + t):
|
|
|
+ raise Exception("MGMT_RX_PROCESS failed")
|
|
|
+ ev = hapd.wait_event(["MGMT-RX"], timeout=5)
|
|
|
+ if ev is None:
|
|
|
+ raise Exception("No response seen at the AP")
|
|
|
+ hapd.dump_monitor()
|
|
|
+
|
|
|
+ hapd.set("ext_mgmt_frame_handling", "0")
|
|
|
+ dev[0].request("SET ext_mgmt_frame_handling 0")
|
|
|
+ dev[0].request("SET LCI ")
|