From: Jouni Malinen Date: Wed, 6 Nov 2024 17:45:37 +0000 (+0200) Subject: tests: WFA generational capabilities indication (automatic) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a209d0c3df01e00d1e93c885d377ff329bc78922;p=thirdparty%2Fhostap.git tests: WFA generational capabilities indication (automatic) Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_wfa_capab.py b/tests/hwsim/test_wfa_capab.py index 2f783052e..862514556 100644 --- a/tests/hwsim/test_wfa_capab.py +++ b/tests/hwsim/test_wfa_capab.py @@ -39,16 +39,30 @@ def test_wfa_gen_capa_unprotected_cert(dev, apdev): finally: dev[0].set("wfa_gen_capa", "0") -def run_wfa_gen_capa(dev, apdev, cert=False): +def test_wfa_gen_capa_automatic(dev, apdev): + """WFA generational capabilities indication (automatic)""" + try: + dev[0].set("wfa_gen_capa", "1") + run_wfa_gen_capa(dev, apdev, automatic=True) + finally: + dev[0].set("wfa_gen_capa", "0") + +def run_wfa_gen_capa(dev, apdev, cert=False, automatic=False): check_sae_capab(dev[0]) params = hostapd.wpa3_params(ssid="wfa-capab", password="12345678") hapd = hostapd.add_ap(apdev[0], params) dev[0].set("sae_groups", "") - dev[0].set("wfa_gen_capa_supp", "07") - if cert: - dev[0].set("wfa_gen_capa_cert", "07") + if automatic: + dev[0].set("wfa_gen_capa_supp", "") + dev[0].set("wfa_gen_capa_cert", "") + else: + dev[0].set("wfa_gen_capa_supp", "07") + if cert: + dev[0].set("wfa_gen_capa_cert", "07") + else: + dev[0].set("wfa_gen_capa_cert", "") dev[0].connect("wfa-capab", sae_password="12345678", key_mgmt="SAE", ieee80211w="2", scan_freq="2412") ev = hapd.wait_event(["WFA-GEN-CAPAB"], timeout=10) @@ -57,5 +71,9 @@ def run_wfa_gen_capa(dev, apdev, cert=False): _, addr, val = ev.split() if addr != dev[0].own_addr(): raise Exception("Unexpected STA address in the indication") - if val != ("01070107" if cert else "0107"): - raise Exception("Unexpected indication value: " + val) + if automatic: + if not val.startswith("01"): + raise Exception("Unexpected indication value: " + val) + else: + if val != ("01070107" if cert else "0107"): + raise Exception("Unexpected indication value: " + val)