From 543f9f7ead0b874f466b37847ed9b542288a4e87 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 12 Apr 2014 18:47:48 +0300 Subject: [PATCH] tests: auto_interworking=1 Signed-off-by: Jouni Malinen --- tests/hwsim/test_ap_hs20.py | 26 ++++++++++++++++++++++++++ tests/hwsim/wpasupplicant.py | 6 +++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index 7cf168c9a..94627f171 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -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() diff --git a/tests/hwsim/wpasupplicant.py b/tests/hwsim/wpasupplicant.py index f71f89e20..a8f3ccfdf 100644 --- a/tests/hwsim/wpasupplicant.py +++ b/tests/hwsim/wpasupplicant.py @@ -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")