tests: HS 2.0 excluded SSID

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2013-11-04 13:22:55 +02:00 committed by Jouni Malinen
parent d1ba402fe5
commit d355372ce4
2 changed files with 25 additions and 5 deletions

View file

@ -276,6 +276,11 @@ def policy_test(dev, ap, values, only_one=True):
dev.remove_cred(id) dev.remove_cred(id)
dev.dump_monitor() dev.dump_monitor()
def default_cred():
return { 'realm': "example.com",
'username': "hs20-test",
'password': "password" }
def test_ap_hs20_req_roaming_consortium(dev, apdev): def test_ap_hs20_req_roaming_consortium(dev, apdev):
"""Hotspot 2.0 required roaming consortium""" """Hotspot 2.0 required roaming consortium"""
params = hs20_ap_params() params = hs20_ap_params()
@ -286,10 +291,24 @@ def test_ap_hs20_req_roaming_consortium(dev, apdev):
params['roaming_consortium'] = [ "223344" ] params['roaming_consortium'] = [ "223344" ]
hostapd.add_ap(apdev[1]['ifname'], params) hostapd.add_ap(apdev[1]['ifname'], params)
values = { 'realm': "example.com", values = default_cred()
'username': "hs20-test", values['required_roaming_consortium'] = "223344"
'password': "password",
'required_roaming_consortium': "223344" }
policy_test(dev[0], apdev[1], values) policy_test(dev[0], apdev[1], values)
values['required_roaming_consortium'] = "112233" values['required_roaming_consortium'] = "112233"
policy_test(dev[0], apdev[0], values) policy_test(dev[0], apdev[0], values)
def test_ap_hs20_excluded_ssid(dev, apdev):
"""Hotspot 2.0 exclusion based on SSID"""
params = hs20_ap_params()
hostapd.add_ap(apdev[0]['ifname'], params)
params = hs20_ap_params()
params['ssid'] = "test-hs20-other"
params['roaming_consortium'] = [ "223344" ]
hostapd.add_ap(apdev[1]['ifname'], params)
values = default_cred()
values['excluded_ssid'] = "test-hs20"
policy_test(dev[0], apdev[1], values)
values['excluded_ssid'] = "test-hs20-other"
policy_test(dev[0], apdev[0], values)

View file

@ -149,7 +149,8 @@ class WpaSupplicant:
def add_cred_values(self, params): def add_cred_values(self, params):
id = self.add_cred() id = self.add_cred()
quoted = [ "realm", "username", "password", "domain", "imsi" ] quoted = [ "realm", "username", "password", "domain", "imsi",
"excluded_ssid" ]
for field in quoted: for field in quoted:
if field in params: if field in params:
self.set_cred_quoted(id, field, params[field]) self.set_cred_quoted(id, field, params[field])