]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: HS 2.0 excluded SSID
authorJouni Malinen <jouni@qca.qualcomm.com>
Mon, 4 Nov 2013 11:22:55 +0000 (13:22 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 4 Nov 2013 12:48:33 +0000 (14:48 +0200)
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>

tests/hwsim/test_ap_hs20.py
tests/hwsim/wpasupplicant.py

index ea67fd141b768fb35dec0a2e005fa7f322758423..9a525d15719db6f6e69bc0496af7ada8a06aae65 100644 (file)
@@ -276,6 +276,11 @@ def policy_test(dev, ap, values, only_one=True):
     dev.remove_cred(id)
     dev.dump_monitor()
 
+def default_cred():
+    return { 'realm': "example.com",
+             'username': "hs20-test",
+             'password': "password" }
+
 def test_ap_hs20_req_roaming_consortium(dev, apdev):
     """Hotspot 2.0 required roaming consortium"""
     params = hs20_ap_params()
@@ -286,10 +291,24 @@ def test_ap_hs20_req_roaming_consortium(dev, apdev):
     params['roaming_consortium'] = [ "223344" ]
     hostapd.add_ap(apdev[1]['ifname'], params)
 
-    values = { 'realm': "example.com",
-               'username': "hs20-test",
-               'password': "password",
-               'required_roaming_consortium': "223344" }
+    values = default_cred()
+    values['required_roaming_consortium'] = "223344"
     policy_test(dev[0], apdev[1], values)
     values['required_roaming_consortium'] = "112233"
     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)
index fddc2f9a268012a428289e17bce2e5b0421b18c7..40d3d33aed11ccc33123e51f3ca0f8fe72af7743 100644 (file)
@@ -149,7 +149,8 @@ class WpaSupplicant:
     def add_cred_values(self, params):
         id = self.add_cred()
 
-        quoted = [ "realm", "username", "password", "domain", "imsi" ]
+        quoted = [ "realm", "username", "password", "domain", "imsi",
+                   "excluded_ssid" ]
         for field in quoted:
             if field in params:
                 self.set_cred_quoted(id, field, params[field])