From: Jouni Malinen Date: Tue, 27 Dec 2016 18:36:14 +0000 (+0200) Subject: tests: More hostapd REQ_RANGE error case coverage X-Git-Tag: hostap_2_7~1904 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8fae7bc12df99c2da6adb5d72f1d5ffa6b8ccc6;p=thirdparty%2Fhostap.git tests: More hostapd REQ_RANGE error case coverage Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_rrm.py b/tests/hwsim/test_rrm.py index c0b1813b0..6f5db14c4 100644 --- a/tests/hwsim/test_rrm.py +++ b/tests/hwsim/test_rrm.py @@ -312,13 +312,23 @@ def test_rrm_ftm_range_req(dev, apdev): raise Exception("REQ_RANGE succeeded unexpectedly (bad responder address 2)") # Bad min_ap value - if "FAIL" not in hapd.request("REQ_RANGE " + dev[0].own_addr() + " 20 10 00:11:22:33:44:55"): + if "FAIL" not in hapd.request("REQ_RANGE " + dev[0].own_addr() + " 10 300 00:11:22:33:44:55"): raise Exception("REQ_RANGE succeeded unexpectedly (invalid min_ap value)") # Bad rand value - if "FAIL" not in hapd.request("REQ_RANGE " + dev[0].own_addr() + " 10 300 00:11:22:33:44:55"): + if "FAIL" not in hapd.request("REQ_RANGE " + dev[0].own_addr() + " -1 10 00:11:22:33:44:55"): + raise Exception("REQ_RANGE succeeded unexpectedly (invalid rand value)") + if "FAIL" not in hapd.request("REQ_RANGE " + dev[0].own_addr() + " 65536 10 00:11:22:33:44:55"): raise Exception("REQ_RANGE succeeded unexpectedly (invalid rand value)") + # Missing min_ap value + if "FAIL" not in hapd.request("REQ_RANGE " + dev[0].own_addr() + " 10"): + raise Exception("REQ_RANGE succeeded unexpectedly (missing min_ap value)") + + # Too many responders + if "FAIL" not in hapd.request("REQ_RANGE " + dev[0].own_addr() + " 10 10" + 20*" 00:11:22:33:44:55"): + raise Exception("REQ_RANGE succeeded unexpectedly (too many responders)") + dev[0].connect("rrm", key_mgmt="NONE", scan_freq="2412") # Responder not in database