From e2afdef223652a3ebc6bdcbeb5eb7c5da049049a Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 1 Mar 2014 11:44:25 +0200 Subject: [PATCH] tests: Verify excluded_ssid with all credential types Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_hs20.py | 21 +++++++++++++++++++++ tests/hwsim/wpasupplicant.py | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index 9d43dd9c4..0fabcd617 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -818,11 +818,14 @@ def test_ap_hs20_req_roaming_consortium(dev, apdev): def test_ap_hs20_excluded_ssid(dev, apdev): """Hotspot 2.0 exclusion based on SSID""" params = hs20_ap_params() + params['roaming_consortium'] = [ "223344" ] + params['anqp_3gpp_cell_net'] = "555,444" hostapd.add_ap(apdev[0]['ifname'], params) params = hs20_ap_params() params['ssid'] = "test-hs20-other" params['roaming_consortium'] = [ "223344" ] + params['anqp_3gpp_cell_net'] = "555,444" hostapd.add_ap(apdev[1]['ifname'], params) values = default_cred() @@ -837,6 +840,24 @@ def test_ap_hs20_excluded_ssid(dev, apdev): if len(ev) != 1: raise Exception("Excluded network not reported") + values = default_cred() + values['roaming_consortium'] = "223344" + values['eap'] = "TTLS" + values['phase2'] = "auth=MSCHAPV2" + values['excluded_ssid'] = "test-hs20" + events = policy_test(dev[0], apdev[1], values) + ev = [e for e in events if "INTERWORKING-BLACKLISTED " + apdev[0]['bssid'] in e] + if len(ev) != 1: + raise Exception("Excluded network not reported") + + values = { 'imsi': "555444-333222111", 'eap': "SIM", + 'milenage': "5122250214c33e723a5dd523fc145fc0:981d464c7c52eb6e5036234984ad0bcf:000000000123", + 'excluded_ssid': "test-hs20" } + events = policy_test(dev[0], apdev[1], values) + ev = [e for e in events if "INTERWORKING-BLACKLISTED " + apdev[0]['bssid'] in e] + if len(ev) != 1: + raise Exception("Excluded network not reported") + def test_ap_hs20_roam_to_higher_prio(dev, apdev): """Hotspot 2.0 and roaming from current to higher priority network""" bssid = apdev[0]['bssid'] diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index 66b3274cd..14875087c 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -210,7 +210,7 @@ class WpaSupplicant: quoted = [ "realm", "username", "password", "domain", "imsi", "excluded_ssid", "milenage", "ca_cert", "client_cert", "private_key", "domain_suffix_match", "provisioning_sp", - "roaming_partner" ] + "roaming_partner", "phase1", "phase2" ] for field in quoted: if field in params: self.set_cred_quoted(id, field, params[field])