]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: Truncated GAS query request
authorJouni Malinen <j@w1.fi>
Thu, 12 Jun 2014 19:09:05 +0000 (22:09 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 12 Jun 2014 21:27:15 +0000 (00:27 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_gas.py

index fd7104536451f499e1460e4f0da5bc2fa485d7d4..7a9b88159154b38fe5e235e0a944db152bbd8e8a 100644 (file)
@@ -728,3 +728,30 @@ def test_gas_no_pending(dev, apdev):
     status_code = gresp['status_code']
     if status_code != 60:
         raise Exception("Unexpected status code {} (expected 60)".format(status_code))
+
+def test_gas_missing_payload(dev, apdev):
+    """No action code in the query frame"""
+    bssid = apdev[0]['bssid']
+    params = hs20_ap_params()
+    params['hessid'] = bssid
+    hostapd.add_ap(apdev[0]['ifname'], params)
+
+    dev[0].scan_for_bss(bssid, freq="2412", force_scan=True)
+
+    cmd = "MGMT_TX {} {} freq=2412 action=040A".format(bssid, bssid)
+    if "FAIL" in dev[0].request(cmd):
+        raise Exception("Could not send test Action frame")
+    ev = dev[0].wait_event(["MGMT-TX-STATUS"], timeout=10)
+    if ev is None:
+        raise Exception("Timeout on MGMT-TX-STATUS")
+    if "result=SUCCESS" not in ev:
+        raise Exception("AP did not ack Action frame")
+
+    cmd = "MGMT_TX {} {} freq=2412 action=04".format(bssid, bssid)
+    if "FAIL" in dev[0].request(cmd):
+        raise Exception("Could not send test Action frame")
+    ev = dev[0].wait_event(["MGMT-TX-STATUS"], timeout=10)
+    if ev is None:
+        raise Exception("Timeout on MGMT-TX-STATUS")
+    if "result=SUCCESS" not in ev:
+        raise Exception("AP did not ack Action frame")