From a27f9f7ac86dac4c4efd2ec8ae1b16c50ac35aa2 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 12 Apr 2014 00:58:52 +0300 Subject: [PATCH] tests: WNM_SLEEP with additional parameters Signed-off-by: Jouni Malinen --- tests/hwsim/test_wnm.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/hwsim/test_wnm.py b/tests/hwsim/test_wnm.py index 6c3d9833e..22c128e0a 100644 --- a/tests/hwsim/test_wnm.py +++ b/tests/hwsim/test_wnm.py @@ -91,13 +91,19 @@ def test_wnm_ess_disassoc_imminent_pmf(dev, apdev): if ev is None: raise Exception("Timeout while waiting for re-connection scan") -def check_wnm_sleep_mode_enter_exit(hapd, dev): +def check_wnm_sleep_mode_enter_exit(hapd, dev, interval=None, tfs_req=None): addr = dev.p2p_interface_addr() sta = hapd.get_sta(addr) if "[WNM_SLEEP_MODE]" in sta['flags']: raise Exception("Station unexpectedly in WNM-Sleep Mode") logger.info("Going to WNM Sleep Mode") - dev.request("WNM_SLEEP enter") + extra = "" + if interval is not None: + extra += " interval=" + str(interval) + if tfs_req: + extra += " tfs_req=" + tfs_req + if "OK" not in dev.request("WNM_SLEEP enter" + extra): + raise Exception("WNM_SLEEP failed") time.sleep(0.5) sta = hapd.get_sta(addr) if "[WNM_SLEEP_MODE]" not in sta['flags']: @@ -121,6 +127,8 @@ def test_wnm_sleep_mode_open(dev, apdev): dev[0].connect("test-wnm", key_mgmt="NONE", scan_freq="2412") check_wnm_sleep_mode_enter_exit(hapd, dev[0]) + check_wnm_sleep_mode_enter_exit(hapd, dev[0], interval=100) + check_wnm_sleep_mode_enter_exit(hapd, dev[0], tfs_req="5b17010001130e110000071122334455661122334455661234") def test_wnm_sleep_mode_rsn(dev, apdev): """WNM Sleep Mode - RSN"""