Browse Source

tests: HS 2.0 subscription remediation notification

Signed-off-by: Jouni Malinen <j@w1.fi>
Jouni Malinen 11 years ago
parent
commit
5cf8801181
2 changed files with 23 additions and 0 deletions
  1. 3 0
      tests/hwsim/auth_serv/eap_user.conf
  2. 20 0
      tests/hwsim/test_ap_hs20.py

+ 3 - 0
tests/hwsim/auth_serv/eap_user.conf

@@ -52,3 +52,6 @@ radius_accept_attr=81:s:2
 
 "hs20-deauth-test"	TTLS-MSCHAPV2	"password"	[2]
 radius_accept_attr=26:x:00009f680405016400
+
+"hs20-subrem-test"	TTLS-MSCHAPV2	"password"	[2]
+radius_accept_attr=26:x:00009f6801170168747470733a2f2f6578616d706c652e636f6d2f

+ 20 - 0
tests/hwsim/test_ap_hs20.py

@@ -1501,6 +1501,26 @@ def test_ap_hs20_deauth_req_from_radius(dev, apdev):
     if ev is None:
         raise Exception("Timeout on disconnection")
 
+def test_ap_hs20_remediation_required(dev, apdev):
+    """Hotspot 2.0 connection and remediation required 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-subrem-test",
+                             'password': "password" })
+    interworking_select(dev[0], bssid, freq="2412")
+    interworking_connect(dev[0], bssid, "TTLS")
+    ev = dev[0].wait_event(["HS20-SUBSCRIPTION-REMEDIATION"], timeout=5)
+    if ev is None:
+        raise Exception("Timeout on subscription remediation notice")
+    if " 1 https://example.com/" not in ev:
+        raise Exception("Unexpected subscription remediation event contents")
+
 def test_ap_hs20_osen(dev, apdev):
     """Hotspot 2.0 OSEN connection"""
     params = { 'ssid': "osen",