]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: GAS/ANQP query without scan
authorJouni Malinen <jouni@codeaurora.org>
Thu, 13 Aug 2020 14:49:16 +0000 (17:49 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 13 Aug 2020 14:51:12 +0000 (17:51 +0300)
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
tests/hwsim/test_gas.py

index ec132f712cd4bee0e531a7c00f179bb627e9865d..5d60779e95317598aa6fe3b554033c67f8e96b90 100644 (file)
@@ -487,6 +487,25 @@ def test_gas_anqp_get(dev, apdev):
         if "FAIL" not in dev[0].request("HS20_ANQP_GET " + cmd):
             raise Exception("Invalid HS20_ANQP_GET accepted")
 
+def test_gas_anqp_get_no_scan(dev, apdev):
+    """GAS/ANQP query without scan"""
+    hapd = start_ap(apdev[0])
+    bssid = apdev[0]['bssid']
+    if "OK" not in dev[0].request("ANQP_GET " + bssid + " freq=2412 258"):
+        raise Exception("ANQP_GET command failed")
+    ev = dev[0].wait_event(["ANQP-QUERY-DONE"], timeout=10)
+    if ev is None:
+        raise Exception("ANQP query timed out")
+    dev[0].dump_monitor()
+
+    if "OK" not in dev[0].request("ANQP_GET 02:11:22:33:44:55 freq=2417 258"):
+        raise Exception("ANQP_GET command failed")
+    ev = dev[0].wait_event(["ANQP-QUERY-DONE"], timeout=10)
+    if ev is None:
+        raise Exception("ANQP query timed out [2]")
+    if "result=FAILURE" not in ev:
+        raise Exception("Unexpected result: " + ev)
+
 def test_gas_anqp_get_oom(dev, apdev):
     """GAS/ANQP query OOM"""
     hapd = start_ap(apdev[0])