From e7869a664a391031b2273edcce06143ec9b24d9a Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 1 Nov 2018 17:10:40 +0200 Subject: [PATCH] tests: sigma_dut AP configuration for Hotspot 2.0 Signed-off-by: Jouni Malinen --- tests/hwsim/test_sigma_dut.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/hwsim/test_sigma_dut.py b/tests/hwsim/test_sigma_dut.py index 8b4bf3302..08a1d8ff2 100644 --- a/tests/hwsim/test_sigma_dut.py +++ b/tests/hwsim/test_sigma_dut.py @@ -2591,3 +2591,31 @@ def run_sigma_dut_hs20_assoc_2(dev, apdev, band, expect_bssid): if "BSSID," + expect_bssid not in res: raise Exception("Unexpected BSSID: " + res) + +def test_sigma_dut_ap_hs20(dev, apdev, params): + """sigma_dut controlled AP with Hotspot 2.0 parameters""" + logdir = os.path.join(params['logdir'], + "sigma_dut_ap_hs20.sigma-hostapd") + with HWSimRadio() as (radio, iface): + sigma = start_sigma_dut(iface, hostapd_logdir=logdir, debug=True) + try: + sigma_dut_cmd_check("ap_reset_default,NAME,AP,program,HS2-R3") + sigma_dut_cmd_check("ap_set_wireless,NAME,AP,WLAN_TAG,1,CHANNEL,1,SSID,test-hs20,MODE,11ng") + sigma_dut_cmd_check("ap_set_radius,NAME,AP,WLAN_TAG,1,IPADDR,127.0.0.1,PORT,1812,PASSWORD,radius") + sigma_dut_cmd_check("ap_set_security,NAME,AP,WLAN_TAG,1,KEYMGNT,WPA2-ENT") + sigma_dut_cmd_check("ap_set_hs2,NAME,AP,WLAN_TAG,1,HESSID,02:12:34:56:78:9a,NAI_REALM_LIST,1,OPER_NAME,1") + sigma_dut_cmd_check("ap_set_hs2,NAME,AP,WLAN_TAG,1,OSU_SERVER_URI,https://example.com/ https://example.org/,OSU_SSID,test-osu,OSU_METHOD,SOAP,OSU_PROVIDER_LIST,10,OSU_PROVIDER_NAI_LIST,4") + sigma_dut_cmd_check("ap_set_hs2,NAME,AP,WLAN_TAG,1,NET_AUTH_TYPE,2") + sigma_dut_cmd_check("ap_set_hs2,NAME,AP,WLAN_TAG,1,VENUE_NAME,1") + sigma_dut_cmd_check("ap_set_hs2,NAME,AP,WLAN_TAG,1,DOMAIN_LIST,example.com") + sigma_dut_cmd_check("ap_set_hs2,NAME,AP,WLAN_TAG,1,OPERATOR_ICON_METADATA,1") + sigma_dut_cmd_check("ap_set_wireless,NAME,AP,WLAN_TAG,2,CHANNEL,1,SSID,test-osu,MODE,11ng") + sigma_dut_cmd_check("ap_set_security,NAME,AP,WLAN_TAG,2,KEYMGNT,NONE") + sigma_dut_cmd_check("ap_config_commit,NAME,AP") + + with open("/tmp/sigma_dut-ap.conf", "r") as f: + logger.debug("hostapd.conf from sigma_dut:\n" + f.read()) + + sigma_dut_cmd_check("ap_reset_default") + finally: + stop_sigma_dut(sigma)