From 2253ea44c289e12238e97bb98cd469f77f1da54a Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 4 Nov 2013 14:39:25 +0200 Subject: [PATCH] tests: HS 2.0 roaming partner preference Signed-hostap: Jouni Malinen --- tests/hwsim/test_ap_hs20.py | 24 ++++++++++++++++++++++++ tests/hwsim/wpasupplicant.py | 3 ++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index 699b199b5..b8ef861c4 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -832,6 +832,30 @@ def test_ap_hs20_domain_suffix_match(dev, apdev): if "Domain suffix mismatch" not in ev: raise Exception("Domain suffix mismatch not reported") +def test_ap_hs20_roaming_partner_preference(dev, apdev): + """Hotspot 2.0 and roaming partner preference""" + params = hs20_ap_params() + params['domain_name'] = "roaming.example.org" + hostapd.add_ap(apdev[0]['ifname'], params) + + params = hs20_ap_params() + params['ssid'] = "test-hs20-other" + params['domain_name'] = "roaming.example.net" + hostapd.add_ap(apdev[1]['ifname'], params) + + logger.info("Verify default vs. specified preference") + values = default_cred() + values['roaming_partner'] = "roaming.example.net,1,127,*" + policy_test(dev[0], apdev[1], values, only_one=False) + values['roaming_partner'] = "roaming.example.net,1,129,*" + policy_test(dev[0], apdev[0], values, only_one=False) + + logger.info("Verify partial FQDN match") + values['roaming_partner'] = "example.net,0,0,*" + policy_test(dev[0], apdev[1], values, only_one=False) + values['roaming_partner'] = "example.net,0,255,*" + policy_test(dev[0], apdev[0], values, only_one=False) + def test_ap_hs20_multi_cred_sp_prio(dev, apdev): """Hotspot 2.0 multi-cred sp_priority""" if not hlr_auc_gw_available(): diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index 5dd6d7f7c..9029f8841 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -209,7 +209,8 @@ class WpaSupplicant: quoted = [ "realm", "username", "password", "domain", "imsi", "excluded_ssid", "milenage", "ca_cert", "client_cert", - "private_key", "domain_suffix_match", "provisioning_sp" ] + "private_key", "domain_suffix_match", "provisioning_sp", + "roaming_partner" ] for field in quoted: if field in params: self.set_cred_quoted(id, field, params[field])