From 3e5f781800df7759b5949a48fbd43642d4a01d14 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Mon, 11 Jul 2016 21:10:59 +0300 Subject: [PATCH] tests: Extend GAS error case coverage Signed-off-by: Jouni Malinen --- tests/hwsim/test_gas.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/hwsim/test_gas.py b/tests/hwsim/test_gas.py index 0bc146094..2d0556cc4 100644 --- a/tests/hwsim/test_gas.py +++ b/tests/hwsim/test_gas.py @@ -388,7 +388,8 @@ def test_gas_anqp_get(dev, apdev): "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" ] + "00:11:22:33:44:55 0", + "00:11:22:33:44:55 1" ] for cmd in cmds: if "FAIL" not in dev[0].request("HS20_ANQP_GET " + cmd): raise Exception("Invalid HS20_ANQP_GET accepted") @@ -402,6 +403,18 @@ def test_gas_anqp_get_oom(dev, apdev): with alloc_fail(dev[0], 1, "wpabuf_alloc;anqp_send_req"): if "FAIL" not in dev[0].request("ANQP_GET " + bssid + " 258,268,hs20:3,hs20:4"): raise Exception("ANQP_GET command accepted during OOM") + with alloc_fail(dev[0], 1, "hs20_build_anqp_req;hs20_anqp_send_req"): + if "FAIL" not in dev[0].request("HS20_ANQP_GET " + bssid + " 1"): + raise Exception("HS20_ANQP_GET command accepted during OOM") + with alloc_fail(dev[0], 1, "gas_query_req;hs20_anqp_send_req"): + if "FAIL" not in dev[0].request("HS20_ANQP_GET " + bssid + " 1"): + raise Exception("HS20_ANQP_GET command accepted during OOM") + with alloc_fail(dev[0], 1, "=hs20_anqp_send_req"): + if "FAIL" not in dev[0].request("REQ_HS20_ICON " + bssid + " w1fi_logo"): + raise Exception("REQ_HS20_ICON command accepted during OOM") + with alloc_fail(dev[0], 2, "=hs20_anqp_send_req"): + if "FAIL" not in dev[0].request("REQ_HS20_ICON " + bssid + " w1fi_logo"): + raise Exception("REQ_HS20_ICON command accepted during OOM") def expect_gas_result(dev, result, status=None): ev = dev.wait_event(["GAS-QUERY-DONE"], timeout=10)