tests: Hotspot 2.0 connection based on roaming_consortiums match

Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
Jouni Malinen 2018-04-17 16:40:14 +03:00 committed by Jouni Malinen
parent 5b7695275c
commit ce952ebda0
2 changed files with 27 additions and 2 deletions

View file

@ -98,7 +98,7 @@ def check_sp_type(dev, sp_type):
if type is None:
raise Exception("sp_type not available")
if type != sp_type:
raise Exception("sp_type did not indicate home network")
raise Exception("sp_type did not indicate %s network" % sp_type)
def hlr_auc_gw_available():
if not os.path.exists("/tmp/hlr_auc_gw.sock"):
@ -1010,6 +1010,30 @@ def test_ap_hs20_roaming_consortium(dev, apdev):
raise Exception("Timeout on already-connected event")
dev[0].remove_cred(id)
def test_ap_hs20_roaming_consortiums_match(dev, apdev):
"""Hotspot 2.0 connection based on roaming_consortiums match"""
bssid = apdev[0]['bssid']
params = hs20_ap_params()
params['hessid'] = bssid
hostapd.add_ap(apdev[0], params)
dev[0].hs20_enable()
for consortium in [ "112233", "ffffff,1020304050,eeeeee" ]:
id = dev[0].add_cred_values({ 'username': "user",
'password': "password",
'domain': "my.home.example.com",
'ca_cert': "auth_serv/ca.pem",
'roaming_consortiums': consortium,
'eap': "PEAP" })
interworking_select(dev[0], bssid, "roaming", freq="2412")
interworking_connect(dev[0], bssid, "PEAP")
check_sp_type(dev[0], "roaming")
dev[0].request("INTERWORKING_SELECT auto freq=2412")
ev = dev[0].wait_event(["INTERWORKING-ALREADY-CONNECTED"], timeout=15)
if ev is None:
raise Exception("Timeout on already-connected event")
dev[0].remove_cred(id)
def test_ap_hs20_roaming_consortium_invalid(dev, apdev):
"""Hotspot 2.0 connection and invalid roaming consortium ANQP-element"""
bssid = apdev[0]['bssid']

View file

@ -379,7 +379,8 @@ class WpaSupplicant:
quoted = [ "realm", "username", "password", "domain", "imsi",
"excluded_ssid", "milenage", "ca_cert", "client_cert",
"private_key", "domain_suffix_match", "provisioning_sp",
"roaming_partner", "phase1", "phase2", "private_key_passwd" ]
"roaming_partner", "phase1", "phase2", "private_key_passwd",
"roaming_consortiums" ]
for field in quoted:
if field in params:
self.set_cred_quoted(id, field, params[field])