]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Add a GAS query timeout test case
authorJouni Malinen <j@w1.fi>
Thu, 26 Dec 2013 06:40:03 +0000 (08:40 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 26 Dec 2013 14:55:45 +0000 (16:55 +0200)
Signed-hostap: Jouni Malinen <j@w1.fi>

tests/hwsim/test_gas.py

index 6f5bf49a1cb6677ee5ef22a35c5fbbddc3c4a3fe..3fb59518a12703d0cb46133096c4cf9c26c47694 100644 (file)
@@ -211,3 +211,29 @@ def test_gas_comeback_delay(dev, apdev):
         ev = dev[0].wait_event(["RX-ANQP"], timeout=5)
         if ev is None:
             raise Exception("Operation timed out")
+
+def test_gas_timeout(dev, apdev):
+    """GAS timeout"""
+    bssid = apdev[0]['bssid']
+    params = hs20_ap_params()
+    params['hessid'] = bssid
+    hostapd.add_ap(apdev[0]['ifname'], params)
+    hapd = hostapd.Hostapd(apdev[0]['ifname'])
+
+    dev[0].scan(freq="2412")
+    hapd.set("ext_mgmt_frame_handling", "1")
+
+    dev[0].request("ANQP_GET " + bssid + " 263")
+    ev = dev[0].wait_event(["GAS-QUERY-START"], timeout=5)
+    if ev is None:
+        raise Exception("GAS query start timed out")
+
+    ev = hapd.wait_event(["MGMT-RX"], timeout=5)
+    if ev is None:
+        raise Exception("MGMT RX wait timed out")
+
+    ev = dev[0].wait_event(["GAS-QUERY-DONE"], timeout=10)
+    if ev is None:
+        raise Exception("GAS query timed out")
+    if "result=TIMEOUT" not in ev:
+        raise Exception("Unexpected GAS query result")