]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: auto_interworking=1
authorJouni Malinen <j@w1.fi>
Sat, 12 Apr 2014 15:47:48 +0000 (18:47 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 13 Apr 2014 07:26:53 +0000 (10:26 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_hs20.py
tests/hwsim/wpasupplicant.py

index 7cf168c9a5eed0c87ff2d2825ed2617de1ad9182..94627f171ccb898cd3db2b09c85d484414745464 100644 (file)
@@ -436,6 +436,32 @@ def test_ap_hs20_username(dev, apdev):
                    ca_cert="auth_serv/ca.pem", phase2="auth=MSCHAPV2",
                    scan_freq="2412")
 
+def test_ap_hs20_auto_interworking(dev, apdev):
+    """Hotspot 2.0 connection with auto_interworking=1"""
+    bssid = apdev[0]['bssid']
+    params = hs20_ap_params()
+    params['hessid'] = bssid
+    params['disable_dgaf'] = '1'
+    hostapd.add_ap(apdev[0]['ifname'], params)
+
+    dev[0].hs20_enable(auto_interworking=True)
+    id = dev[0].add_cred_values({ 'realm': "example.com",
+                                  'username': "hs20-test",
+                                  'password': "password",
+                                  'ca_cert': "auth_serv/ca.pem",
+                                  'domain': "example.com",
+                                  'update_identifier': "1234" })
+    dev[0].request("REASSOCIATE")
+    ev = dev[0].wait_event(["CTRL-EVENT-CONNECTED"], timeout=15)
+    if ev is None:
+        raise Exception("Connection timed out")
+    check_sp_type(dev[0], "home")
+    status = dev[0].get_status()
+    if status['pairwise_cipher'] != "CCMP":
+        raise Exception("Unexpected pairwise cipher")
+    if status['hs20'] != "2":
+        raise Exception("Unexpected HS 2.0 support indication")
+
 def eap_test(dev, ap, eap_params, method, user):
     bssid = ap['bssid']
     params = hs20_ap_params()
index f71f89e20fc5e3716f98fda47f2ceeafad16feac..a8f3ccfdfb852e1aad0aee9aba6b5de0d5cc1b7e 100644 (file)
@@ -178,9 +178,13 @@ class WpaSupplicant:
             networks.append(network)
         return networks
 
-    def hs20_enable(self):
+    def hs20_enable(self, auto_interworking=False):
         self.request("SET interworking 1")
         self.request("SET hs20 1")
+        if auto_interworking:
+            self.request("SET auto_interworking 1")
+        else:
+            self.request("SET auto_interworking 0")
 
     def add_cred(self):
         id = self.request("ADD_CRED")