]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Additional ANQP_GET and HS20_ANQP_GET error coverage
authorJouni Malinen <j@w1.fi>
Wed, 10 Dec 2014 23:49:32 +0000 (01:49 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 11 Dec 2014 13:18:11 +0000 (15:18 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_gas.py

index 7a9b88159154b38fe5e235e0a944db152bbd8e8a..de5ef6d5a13da0f0fb91581635dd2700827b7fcf 100644 (file)
@@ -266,6 +266,33 @@ def test_gas_anqp_get(dev, apdev):
     if ev is None or "WAN Metrics" not in ev:
         raise Exception("Did not receive WAN Metrics")
 
+    cmds = [ "",
+             "foo",
+             "00:11:22:33:44:55 258,hs20:-1",
+             "00:11:22:33:44:55 258,hs20:0",
+             "00:11:22:33:44:55 258,hs20:32",
+             "00:11:22:33:44:55 hs20:-1",
+             "00:11:22:33:44:55 hs20:0",
+             "00:11:22:33:44:55 hs20:32",
+             "00:11:22:33:44:55",
+             "00:11:22:33:44:55 ",
+             "00:11:22:33:44:55 0" ]
+    for cmd in cmds:
+        if "FAIL" not in dev[0].request("ANQP_GET " + cmd):
+            raise Exception("Invalid ANQP_GET accepted")
+
+    cmds = [ "",
+             "foo",
+             "00:11:22:33:44:55 -1",
+             "00:11:22:33:44:55 0",
+             "00:11:22:33:44:55 32",
+             "00:11:22:33:44:55",
+             "00:11:22:33:44:55 ",
+             "00:11:22:33:44:55 0" ]
+    for cmd in cmds:
+        if "FAIL" not in dev[0].request("HS20_ANQP_GET " + cmd):
+            raise Exception("Invalid HS20_ANQP_GET accepted")
+
 def expect_gas_result(dev, result, status=None):
     ev = dev.wait_event(["GAS-QUERY-DONE"], timeout=10)
     if ev is None: