diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index a9f0d528f..796b4f35f 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -255,6 +255,54 @@ def test_ap_hs20_username_unknown2(dev, apdev): interworking_connect(dev[0], bssid, "TTLS") check_sp_type(dev[0], "unknown") +def test_ap_hs20_gas_while_associated(dev, apdev): + """Hotspot 2.0 connection with GAS query while associated""" + bssid = apdev[0]['bssid'] + params = hs20_ap_params() + params['hessid'] = bssid + hostapd.add_ap(apdev[0]['ifname'], params) + + dev[0].request("SET ignore_old_scan_res 1") + dev[0].hs20_enable() + id = dev[0].add_cred_values({ 'realm': "example.com", + 'username': "hs20-test", + 'password': "password", + 'domain': "example.com" }) + interworking_select(dev[0], bssid, "home") + interworking_connect(dev[0], bssid, "TTLS") + + logger.info("Verifying GAS query while associated") + dev[0].request("FETCH_ANQP") + for i in range(0, 6): + ev = dev[0].wait_event(["RX-ANQP"], timeout=5) + if ev is None: + raise Exception("Operation timed out") + +def test_ap_hs20_gas_frag_while_associated(dev, apdev): + """Hotspot 2.0 connection with fragmented GAS query while associated""" + bssid = apdev[0]['bssid'] + params = hs20_ap_params() + params['hessid'] = bssid + hostapd.add_ap(apdev[0]['ifname'], params) + hapd = hostapd.Hostapd(apdev[0]['ifname']) + hapd.set("gas_frag_limit", "50") + + dev[0].request("SET ignore_old_scan_res 1") + dev[0].hs20_enable() + id = dev[0].add_cred_values({ 'realm': "example.com", + 'username': "hs20-test", + 'password': "password", + 'domain': "example.com" }) + interworking_select(dev[0], bssid, "home") + interworking_connect(dev[0], bssid, "TTLS") + + logger.info("Verifying GAS query while associated") + dev[0].request("FETCH_ANQP") + for i in range(0, 6): + ev = dev[0].wait_event(["RX-ANQP"], timeout=5) + if ev is None: + raise Exception("Operation timed out") + def test_ap_hs20_multiple_connects(dev, apdev): """Hotspot 2.0 connection through multiple network selections""" bssid = apdev[0]['bssid']