From 8fc1f204df44c4fd52821d507d851d7da999f2e1 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 10 Mar 2014 11:34:31 +0200 Subject: [PATCH] tests: HS 2.0 session information URL Verify that session information is stored from Access-Accept and sent to the station at the requested timeout. Verify that station processes this notification. Signed-off-by: Jouni Malinen --- tests/hwsim/auth_serv/eap_user.conf | 4 ++++ tests/hwsim/test_ap_hs20.py | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/tests/hwsim/auth_serv/eap_user.conf b/tests/hwsim/auth_serv/eap_user.conf index 28ca32783..ffda9d877 100644 --- a/tests/hwsim/auth_serv/eap_user.conf +++ b/tests/hwsim/auth_serv/eap_user.conf @@ -62,3 +62,7 @@ radius_accept_attr=26:x:00009f680405016400 "hs20-subrem-test" TTLS-MSCHAPV2 "password" [2] radius_accept_attr=26:x:00009f6801170168747470733a2f2f6578616d706c652e636f6d2f + +"hs20-session-info-test" TTLS-MSCHAPV2 "password" [2] +radius_accept_attr=27:d:63 +radius_accept_attr=26:x:00009f6805170168747470733a2f2f6578616d706c652e636f6d2f diff --git a/tests/hwsim/test_ap_hs20.py b/tests/hwsim/test_ap_hs20.py index a79808f59..00a3db6f9 100644 --- a/tests/hwsim/test_ap_hs20.py +++ b/tests/hwsim/test_ap_hs20.py @@ -1521,6 +1521,32 @@ def test_ap_hs20_remediation_required(dev, apdev): if " 1 https://example.com/" not in ev: raise Exception("Unexpected subscription remediation event contents") +def test_ap_hs20_session_info(dev, apdev): + """Hotspot 2.0 connection and session information from RADIUS""" + bssid = apdev[0]['bssid'] + params = hs20_ap_params() + params['nai_realm'] = [ "0,example.com,21[2:4]" ] + hostapd.add_ap(apdev[0]['ifname'], params) + + dev[0].request("SET pmf 1") + dev[0].hs20_enable() + dev[0].add_cred_values({ 'realm': "example.com", + 'username': "hs20-session-info-test", + 'password': "password" }) + interworking_select(dev[0], bssid, freq="2412") + interworking_connect(dev[0], bssid, "TTLS") + ev = dev[0].wait_event(["ESS-DISASSOC-IMMINENT"], timeout=10) + if ev is None: + raise Exception("Timeout on ESS disassociation imminent notice") + if " 1 59904 https://example.com/" not in ev: + raise Exception("Unexpected ESS disassociation imminent event contents") + ev = dev[0].wait_event(["CTRL-EVENT-SCAN-STARTED"]) + if ev is None: + raise Exception("Scan not started") + ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"]) + if ev is None: + raise Exception("Scan not completed") + def test_ap_hs20_osen(dev, apdev): """Hotspot 2.0 OSEN connection""" params = { 'ssid': "osen",