]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: More hostapd REQ_RANGE error case coverage
authorJouni Malinen <j@w1.fi>
Tue, 27 Dec 2016 18:36:14 +0000 (20:36 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 28 Dec 2016 12:31:42 +0000 (14:31 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_rrm.py

index c0b1813b087c7bea35105d9722e0fb551b150e84..6f5db14c447db656aebc3f4a093c60f29873e156 100644 (file)
@@ -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