From dc15e92b4683d61b55fae6881729a5827fc8c591 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 12 Feb 2017 18:15:37 +0200 Subject: [PATCH] tests: WNM Disassociation Imminent failure cases Signed-off-by: Jouni Malinen --- tests/hwsim/test_wnm.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/hwsim/test_wnm.py b/tests/hwsim/test_wnm.py index 60da98bff..d7223bd7e 100644 --- a/tests/hwsim/test_wnm.py +++ b/tests/hwsim/test_wnm.py @@ -62,6 +62,17 @@ def test_wnm_disassoc_imminent(dev, apdev): if ev is None: raise Exception("Timeout while waiting for re-connection scan") +def test_wnm_disassoc_imminent_fail(dev, apdev): + """WNM Disassociation Imminent failure""" + params = { "ssid": "test-wnm", "bss_transition": "1" } + hapd = hostapd.add_ap(apdev[0], params) + + dev[0].connect("test-wnm", key_mgmt="NONE", scan_freq="2412") + addr = dev[0].own_addr() + with fail_test(hapd, 1, "wnm_send_disassoc_imminent"): + if "FAIL" not in hapd.request("DISASSOC_IMMINENT " + addr + " 10"): + raise Exception("DISASSOC_IMMINENT succeeded during failure testing") + @remote_compatible def test_wnm_ess_disassoc_imminent(dev, apdev): """WNM ESS Disassociation Imminent""" @@ -84,6 +95,19 @@ def test_wnm_ess_disassoc_imminent(dev, apdev): if ev is None: raise Exception("Timeout while waiting for re-connection scan") +def test_wnm_ess_disassoc_imminent_fail(dev, apdev): + """WNM ESS Disassociation Imminent failure""" + params = { "ssid": "test-wnm", "bss_transition": "1" } + hapd = hostapd.add_ap(apdev[0], params) + + dev[0].connect("test-wnm", key_mgmt="NONE", scan_freq="2412") + addr = dev[0].own_addr() + if "FAIL" not in hapd.request("ESS_DISASSOC " + addr + " 10 http://" + 256*'a'): + raise Exception("Invalid ESS_DISASSOC URL accepted") + with fail_test(hapd, 1, "wnm_send_ess_disassoc_imminent"): + if "FAIL" not in hapd.request("ESS_DISASSOC " + addr + " 10 http://example.com/session-info"): + raise Exception("ESS_DISASSOC succeeded during failure testing") + def test_wnm_ess_disassoc_imminent_reject(dev, apdev): """WNM ESS Disassociation Imminent getting rejected""" params = { "ssid": "test-wnm",