tests: Check for beacon loss when using beacon protection

This extends testing coverage to detect an issue that was fixed in
commit bf9cbb462f ("Fix writing of BIGTK in FT protocol").

Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
Jouni Malinen 2023-08-10 21:26:36 +03:00 committed by Jouni Malinen
parent bf9cbb462f
commit 011775af94
2 changed files with 7 additions and 0 deletions

View file

@ -560,6 +560,9 @@ def test_ap_ft_pmf_required_over_ds(dev, apdev):
def test_ap_ft_pmf_beacon_prot(dev, apdev): def test_ap_ft_pmf_beacon_prot(dev, apdev):
"""WPA2-PSK-FT AP with PMF and beacon protection""" """WPA2-PSK-FT AP with PMF and beacon protection"""
run_ap_ft_pmf(dev, apdev, "1", beacon_prot=True) run_ap_ft_pmf(dev, apdev, "1", beacon_prot=True)
ev = dev[0].wait_event(["CTRL-EVENT-BEACON-LOSS"], timeout=5)
if ev is not None:
raise Exception("Beacon loss detected")
def run_ap_ft_pmf(dev, apdev, ieee80211w, over_ds=False, beacon_prot=False): def run_ap_ft_pmf(dev, apdev, ieee80211w, over_ds=False, beacon_prot=False):
ssid = "test-ft" ssid = "test-ft"

View file

@ -1371,6 +1371,10 @@ def run_ap_pmf_beacon_protection(dev, apdev, cipher):
if valid_bip < 0 or invalid_bip > 0 or missing_bip > 0: if valid_bip < 0 or invalid_bip > 0 or missing_bip > 0:
raise Exception("Unexpected wlantest BIP counters: valid=%d invalid=%d missing=%d" % (valid_bip, invalid_bip, missing_bip)) raise Exception("Unexpected wlantest BIP counters: valid=%d invalid=%d missing=%d" % (valid_bip, invalid_bip, missing_bip))
ev = dev[0].wait_event(["CTRL-EVENT-BEACON-LOSS"], timeout=5)
if ev is not None:
raise Exception("Beacon loss detected")
def test_ap_pmf_beacon_protection_mismatch(dev, apdev): def test_ap_pmf_beacon_protection_mismatch(dev, apdev):
"""WPA2-PSK Beacon protection MIC mismatch""" """WPA2-PSK Beacon protection MIC mismatch"""
run_ap_pmf_beacon_protection_mismatch(dev, apdev, False) run_ap_pmf_beacon_protection_mismatch(dev, apdev, False)