From cd18ec3b0a6172c02940da8c004b9031c705ed9b Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 29 Feb 2016 19:49:52 +0200 Subject: [PATCH] tests: GAS query with another AP while associated This is without PMF to cover the case of Public Action frame to another AP while associated. Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_hs20.py | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index 5cf784af4..1fac33d77 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -914,6 +914,44 @@ def test_ap_hs20_gas_while_associated(dev, apdev): if ev is None: raise Exception("Operation timed out") +def test_ap_hs20_gas_with_another_ap_while_associated(dev, apdev): + """GAS query with another AP while associated""" + check_eap_capa(dev[0], "MSCHAPV2") + bssid = apdev[0]['bssid'] + params = hs20_ap_params() + params['hessid'] = bssid + hostapd.add_ap(apdev[0]['ifname'], params) + + bssid2 = apdev[1]['bssid'] + params = hs20_ap_params() + params['hessid'] = bssid2 + params['nai_realm'] = [ "0,no-match.example.org,13[5:6],21[2:4][5:7]" ] + hostapd.add_ap(apdev[1]['ifname'], params) + + dev[0].hs20_enable() + id = dev[0].add_cred_values({ 'realm': "example.com", + 'ca_cert': "auth_serv/ca.pem", + 'username': "hs20-test", + 'password': "password", + 'domain': "example.com" }) + interworking_select(dev[0], bssid, "home", freq="2412") + interworking_connect(dev[0], bssid, "TTLS") + dev[0].dump_monitor() + + logger.info("Verifying GAS query with same AP while associated") + dev[0].request("ANQP_GET " + bssid + " 263") + ev = dev[0].wait_event(["RX-ANQP"], timeout=5) + if ev is None: + raise Exception("ANQP operation timed out") + dev[0].dump_monitor() + + logger.info("Verifying GAS query with another AP while associated") + dev[0].scan_for_bss(bssid2, 2412) + dev[0].request("ANQP_GET " + bssid2 + " 263") + ev = dev[0].wait_event(["RX-ANQP"], timeout=5) + if ev is None: + raise Exception("ANQP operation timed out") + def test_ap_hs20_gas_while_associated_with_pmf(dev, apdev): """Hotspot 2.0 connection with GAS query while associated and using PMF""" check_eap_capa(dev[0], "MSCHAPV2")