From 5cf2f7b3db086b1dd1e6ad563529aad9664557ba Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 12 Feb 2017 18:01:03 +0200 Subject: [PATCH] tests: WNM BSS TM - protocol testing for AP message parsing Signed-off-by: Jouni Malinen --- tests/hwsim/test_wnm.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/hwsim/test_wnm.py b/tests/hwsim/test_wnm.py index e59acfa25..7592a4383 100644 --- a/tests/hwsim/test_wnm.py +++ b/tests/hwsim/test_wnm.py @@ -1538,3 +1538,34 @@ def test_wnm_bss_tm_reject(dev, apdev): hapd.request("DISABLE") subprocess.call(['iw', 'reg', 'set', '00']) dev[0].flush_scan_cache() + +def test_wnm_bss_tm_ap_proto(dev, apdev): + """WNM BSS TM - protocol testing for AP message parsing""" + params = { "ssid": "test-wnm", "bss_transition": "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 = [ "0a", + "0a06", + "0a0601", + "0a060100", + "0a080000", + "0a08000000", + "0a080000001122334455", + "0a08000000112233445566", + "0a08000000112233445566112233445566778899", + "0a08ffffff", + "0a08ffffff112233445566778899", + "0a1a", + "0a1a00", + "0a1a0000", + "0aff" ] + 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")