]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: WNM Sleep Mode - protocol testing
authorJouni Malinen <j@w1.fi>
Sun, 12 Feb 2017 09:46:13 +0000 (11:46 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 12 Feb 2017 15:44:56 +0000 (17:44 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_wnm.py

index 37afe0dec1602d461c555dfb68f6596469071e08..34912098f2b800e97ca93981e8b69d1fd7edafe1 100644 (file)
@@ -235,6 +235,28 @@ def test_wnm_sleep_mode_rsn_pmf(dev, apdev):
         raise Exception("No connection event received from hostapd")
     check_wnm_sleep_mode_enter_exit(hapd, dev[0])
 
+def test_wnm_sleep_mode_proto(dev, apdev):
+    """WNM Sleep Mode - protocol testing"""
+    params = { "ssid": "test-wnm", "wnm_sleep_mode": "1" }
+    hapd = hostapd.add_ap(apdev[0], params)
+    bssid = hapd.own_addr()
+    dev[0].connect("test-wnm", key_mgmt="NONE", scan_freq="2412")
+    addr = dev[0].own_addr()
+
+    hdr = "d0003a01" + bssid.replace(':', '') + addr.replace(':', '') + bssid.replace(':', '') + "1000"
+    hapd.set("ext_mgmt_frame_handling", "1")
+    tests = [ "0a1001",
+              "0a10015d00",
+              "0a10015d01",
+              "0a10015d0400000000",
+              "0a1001" + 7*("5bff" + 255*"00") + "5d00",
+              "0a1001ff00" ]
+    for t in tests:
+        if "OK" not in hapd.request("MGMT_RX_PROCESS freq=2412 datarate=0 ssi_signal=-30 frame=" + hdr + t):
+            raise Exception("MGMT_RX_PROCESS failed")
+
+    hapd.set("ext_mgmt_frame_handling", "0")
+
 MGMT_SUBTYPE_ACTION = 13
 ACTION_CATEG_WNM = 10
 WNM_ACT_BSS_TM_REQ = 7