]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Verify excluded_ssid with all credential types
authorJouni Malinen <j@w1.fi>
Sat, 1 Mar 2014 09:44:25 +0000 (11:44 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 2 Mar 2014 08:35:34 +0000 (10:35 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_hs20.py
tests/hwsim/wpasupplicant.py

index 9d43dd9c44d908fbbe799b1bace919ac7845640c..0fabcd6178324f5f10ce7e773e3d2950691ee195 100644 (file)
@@ -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']
index 66b3274cdeb1025167aa8821758c64dd9b77e419..14875087c4ca7efe6504115f5389477917c2ff54 100644 (file)
@@ -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])