]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Verify HS 2.0 deauth request from RADIUS Access-Accept
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 7 Mar 2014 21:21:17 +0000 (23:21 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 8 Mar 2014 09:35:08 +0000 (11:35 +0200)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/auth_serv/eap_user.conf
tests/hwsim/test_ap_hs20.py

index f31fae7611736083ff549f0bdf604eaa2d18677b..ee90547654f263976df978a5ffbeb905bce082cc 100644 (file)
@@ -39,3 +39,6 @@
 
 "user" MSCHAPV2,MD5,GTC        "password"      [2]
 "cert user"    TLS     [2]
+
+"hs20-deauth-test"     TTLS-MSCHAPV2   "password"      [2]
+radius_accept_attr=26:x:00009f680405016400
index adbfbd33b9af1f7c450aeda72404a99386097ba6..1d737dd2b5c4394a248e23e316b836775c5ae2e7 100644 (file)
@@ -1477,6 +1477,30 @@ def test_ap_hs20_deauth_req_bss(dev, apdev):
     if ev is not None:
         raise Exception("Unexpected connection attempt")
 
+def test_ap_hs20_deauth_req_from_radius(dev, apdev):
+    """Hotspot 2.0 connection and deauthentication request from RADIUS"""
+    bssid = apdev[0]['bssid']
+    params = hs20_ap_params()
+    params['nai_realm'] = [ "0,example.com,21[2:4]" ]
+    params['hs20_deauth_req_timeout'] = "2"
+    hostapd.add_ap(apdev[0]['ifname'], params)
+
+    dev[0].request("SET pmf 2")
+    dev[0].hs20_enable()
+    dev[0].add_cred_values({ 'realm': "example.com",
+                             'username': "hs20-deauth-test",
+                             'password': "password" })
+    interworking_select(dev[0], bssid, freq="2412")
+    interworking_connect(dev[0], bssid, "TTLS")
+    ev = dev[0].wait_event(["HS20-DEAUTH-IMMINENT-NOTICE"], timeout=5)
+    if ev is None:
+        raise Exception("Timeout on deauth imminent notice")
+    if " 1 100" not in ev:
+        raise Exception("Unexpected deauth imminent contents")
+    ev = dev[0].wait_event(["CTRL-EVENT-DISCONNECTED"], timeout=3)
+    if ev is None:
+        raise Exception("Timeout on disconnection")
+
 def test_ap_hs20_osen(dev, apdev):
     """Hotspot 2.0 OSEN connection"""
     params = { 'ssid': "osen",