tests: Radio measurement capability with roaming
This verifies that radio measurement capabilities are negotiated correctly for the reassociation cases with and without FT. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
8c41734e5d
commit
392aba4e87
2 changed files with 62 additions and 0 deletions
|
@ -18,6 +18,7 @@ from tshark import run_tshark
|
||||||
from utils import HwsimSkip, alloc_fail, fail_test, wait_fail_trigger, skip_with_fips, parse_ie
|
from utils import HwsimSkip, alloc_fail, fail_test, wait_fail_trigger, skip_with_fips, parse_ie
|
||||||
from wlantest import Wlantest
|
from wlantest import Wlantest
|
||||||
from test_ap_psk import check_mib, find_wpas_process, read_process_memory, verify_not_present, get_key_locations
|
from test_ap_psk import check_mib, find_wpas_process, read_process_memory, verify_not_present, get_key_locations
|
||||||
|
from test_rrm import check_beacon_req
|
||||||
|
|
||||||
def ft_base_rsn():
|
def ft_base_rsn():
|
||||||
params = { "wpa": "2",
|
params = { "wpa": "2",
|
||||||
|
@ -2482,3 +2483,31 @@ def test_ap_ft_eap_sha384_over_ds(dev, apdev):
|
||||||
|
|
||||||
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True,
|
run_roams(dev[0], apdev, hapd0, hapd1, ssid, passphrase, over_ds=True,
|
||||||
eap=True, sha384=True)
|
eap=True, sha384=True)
|
||||||
|
|
||||||
|
def test_ap_ft_roam_rrm(dev, apdev):
|
||||||
|
"""WPA2-PSK-FT AP and radio measurement request"""
|
||||||
|
ssid = "test-ft"
|
||||||
|
passphrase="12345678"
|
||||||
|
|
||||||
|
params = ft_params1(ssid=ssid, passphrase=passphrase)
|
||||||
|
params["rrm_beacon_report"] = "1"
|
||||||
|
hapd0 = hostapd.add_ap(apdev[0], params)
|
||||||
|
bssid0 = hapd0.own_addr()
|
||||||
|
|
||||||
|
addr = dev[0].own_addr()
|
||||||
|
dev[0].connect(ssid, psk=passphrase, key_mgmt="FT-PSK", proto="WPA2",
|
||||||
|
scan_freq="2412")
|
||||||
|
check_beacon_req(hapd0, addr, 1)
|
||||||
|
|
||||||
|
params = ft_params2(ssid=ssid, passphrase=passphrase)
|
||||||
|
params["rrm_beacon_report"] = "1"
|
||||||
|
hapd1 = hostapd.add_ap(apdev[1], params)
|
||||||
|
bssid1 = hapd1.own_addr()
|
||||||
|
|
||||||
|
dev[0].scan_for_bss(bssid1, freq=2412)
|
||||||
|
dev[0].roam(bssid1)
|
||||||
|
check_beacon_req(hapd1, addr, 2)
|
||||||
|
|
||||||
|
dev[0].scan_for_bss(bssid0, freq=2412)
|
||||||
|
dev[0].roam(bssid0)
|
||||||
|
check_beacon_req(hapd0, addr, 3)
|
||||||
|
|
|
@ -1924,3 +1924,36 @@ def test_rrm_unexpected(dev, apdev):
|
||||||
for t in tests:
|
for t in tests:
|
||||||
if "OK" not in hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + hdr + t):
|
if "OK" not in hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + hdr + t):
|
||||||
raise Exception("MGMT_RX_PROCESS failed for " + t)
|
raise Exception("MGMT_RX_PROCESS failed for " + t)
|
||||||
|
|
||||||
|
def check_beacon_req(hapd, addr, idx):
|
||||||
|
request = "51000000000002ffffffffffff" + "020100"
|
||||||
|
token = hapd.request("REQ_BEACON " + addr + " " + request)
|
||||||
|
if "FAIL" in token:
|
||||||
|
raise Exception("REQ_BEACON failed (%d)" % idx)
|
||||||
|
ev = hapd.wait_event(["BEACON-RESP-RX"], timeout=10)
|
||||||
|
if ev is None:
|
||||||
|
raise Exception("Beacon report response not received (%d)" % idx)
|
||||||
|
|
||||||
|
def test_rrm_reassociation(dev, apdev):
|
||||||
|
"""Radio measurement request - reassociation"""
|
||||||
|
params = { "ssid": "rrm", "rrm_beacon_report": "1" }
|
||||||
|
hapd = hostapd.add_ap(apdev[0]['ifname'], params)
|
||||||
|
bssid = hapd.own_addr()
|
||||||
|
|
||||||
|
addr = dev[0].own_addr()
|
||||||
|
dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412")
|
||||||
|
check_beacon_req(hapd, addr, 1)
|
||||||
|
|
||||||
|
dev[0].request("REASSOCIATE")
|
||||||
|
dev[0].wait_connected()
|
||||||
|
check_beacon_req(hapd, addr, 1)
|
||||||
|
|
||||||
|
hapd2 = hostapd.add_ap(apdev[1]['ifname'], params)
|
||||||
|
bssid2 = hapd2.own_addr()
|
||||||
|
dev[0].scan_for_bss(bssid2, freq=2412)
|
||||||
|
dev[0].roam(bssid2)
|
||||||
|
check_beacon_req(hapd2, addr, 2)
|
||||||
|
|
||||||
|
dev[0].scan_for_bss(bssid, freq=2412)
|
||||||
|
dev[0].roam(bssid)
|
||||||
|
check_beacon_req(hapd, addr, 3)
|
||||||
|
|
Loading…
Reference in a new issue