From de3815c71b074055e33979c4839f22ce3c758dbd Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 14 Apr 2019 17:21:13 +0300 Subject: [PATCH] tests: WNM BSS Transition Management and steering timeout Signed-off-by: Jouni Malinen --- tests/hwsim/test_wnm.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/hwsim/test_wnm.py b/tests/hwsim/test_wnm.py index 75be0f701..d159bd80a 100644 --- a/tests/hwsim/test_wnm.py +++ b/tests/hwsim/test_wnm.py @@ -837,6 +837,33 @@ def test_wnm_bss_tm(dev, apdev): finally: clear_regdom_state(dev, hapd, hapd2) +def test_wnm_bss_tm_steering_timeout(dev, apdev): + """WNM BSS Transition Management and steering timeout""" + hapd = start_wnm_ap(apdev[0]) + id = dev[0].connect("test-wnm", key_mgmt="NONE", scan_freq="2412") + hapd2 = start_wnm_ap(apdev[1]) + dev[0].scan_for_bss(apdev[1]['bssid'], 2412) + hapd2.disable() + addr = dev[0].own_addr() + if "OK" not in hapd.request("BSS_TM_REQ " + addr + " pref=1 abridged=1 valid_int=255 neighbor=" + apdev[1]['bssid'] + ",0x0000,81,1,7,0301ff"): + raise Exception("BSS_TM_REQ command failed") + ev = hapd.wait_event(['BSS-TM-RESP'], timeout=5) + if ev is None: + raise Exception("No BSS Transition Management Response") + if "status_code=0" not in ev: + raise Exception("BSS transition request was not accepted: " + ev) + # Wait for the ap_sta_reset_steer_flag_timer timeout to occur + # "Reset steering flag for STA 02:00:00:00:00:00" + time.sleep(2.1) + + ev = dev[0].wait_event(["Trying to authenticate"], timeout=5) + if ev is None: + raise Exception("No authentication attempt seen") + if hapd2.own_addr() not in ev: + raise Exception("Unexpected authentication target: " + ev) + # Wait for return back to the previous AP + dev[0].wait_connected() + def test_wnm_bss_tm_errors(dev, apdev): """WNM BSS Transition Management errors""" hapd = start_wnm_ap(apdev[0])