From ea68ed56b9f21b037c986e7a5aa968d9b323efb0 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 11 Dec 2014 01:49:32 +0200 Subject: [PATCH] tests: Additional ANQP_GET and HS20_ANQP_GET error coverage Signed-off-by: Jouni Malinen --- tests/hwsim/test_gas.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/hwsim/test_gas.py b/tests/hwsim/test_gas.py index 7a9b88159..de5ef6d5a 100644 --- a/tests/hwsim/test_gas.py +++ b/tests/hwsim/test_gas.py @@ -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: