]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: roaming_consortium_selection
authorJouni Malinen <jouni@codeaurora.org>
Tue, 17 Apr 2018 14:14:47 +0000 (17:14 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 17 Apr 2018 22:12:23 +0000 (01:12 +0300)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_ap_hs20.py
tests/hwsim/wpasupplicant.py

index a52b958d53267b3a2be1878fe80675e0aa9a5350..e9afd1b5c1585be418f68ebc64c7142894931219 100644 (file)
@@ -1018,7 +1018,9 @@ def test_ap_hs20_roaming_consortiums_match(dev, apdev):
     hostapd.add_ap(apdev[0], params)
 
     dev[0].hs20_enable()
-    for consortium in [ "112233", "ffffff,1020304050,eeeeee" ]:
+    tests = [ ("112233", "112233"),
+              ("ffffff,1020304050,eeeeee", "1020304050") ]
+    for consortium,selected in tests:
         id = dev[0].add_cred_values({ 'username': "user",
                                       'password': "password",
                                       'domain': "my.home.example.com",
@@ -1028,6 +1030,11 @@ def test_ap_hs20_roaming_consortiums_match(dev, apdev):
         interworking_select(dev[0], bssid, "roaming", freq="2412")
         interworking_connect(dev[0], bssid, "PEAP")
         check_sp_type(dev[0], "roaming")
+        network_id = dev[0].get_status_field("id")
+        sel = dev[0].get_network(network_id, "roaming_consortium_selection")
+        if sel != selected:
+            raise Exception("Unexpected roaming_consortium_selection value: " +
+                            sel)
         dev[0].request("INTERWORKING_SELECT auto freq=2412")
         ev = dev[0].wait_event(["INTERWORKING-ALREADY-CONNECTED"], timeout=15)
         if ev is None:
@@ -3683,9 +3690,14 @@ def test_ap_hs20_external_selection(dev, apdev):
     dev[0].connect("test-hs20", proto="RSN", key_mgmt="WPA-EAP", eap="TTLS",
                    identity="hs20-test", password="password",
                    ca_cert="auth_serv/ca.pem", phase2="auth=MSCHAPV2",
-                   scan_freq="2412", update_identifier="54321")
+                   scan_freq="2412", update_identifier="54321",
+                   roaming_consortium_selection="1020304050")
     if dev[0].get_status_field("hs20") != "2":
         raise Exception("Unexpected hs20 indication")
+    network_id = dev[0].get_status_field("id")
+    sel = dev[0].get_network(network_id, "roaming_consortium_selection")
+    if sel != "1020304050":
+        raise Exception("Unexpected roaming_consortium_selection value: " + sel)
 
 def test_ap_hs20_random_mac_addr(dev, apdev):
     """Hotspot 2.0 connection with random MAC address"""
index 5992c51fdb4d5fbbdf88d111509ed925a20b9f2b..f0cbe6bf78b5fa263ea44875f0df6d5e10a97ae4 100644 (file)
@@ -1029,7 +1029,8 @@ class WpaSupplicant:
                        "engine", "fils_dh_group", "bssid_hint",
                        "dpp_csign", "dpp_csign_expiry",
                        "dpp_netaccesskey", "dpp_netaccesskey_expiry",
-                       "group_mgmt", "owe_group" ]
+                       "group_mgmt", "owe_group",
+                       "roaming_consortium_selection" ]
         for field in not_quoted:
             if field in kwargs and kwargs[field]:
                 self.set_network(id, field, kwargs[field])