aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2016-11-17 14:00:10 (GMT)
committerJouni Malinen <j@w1.fi>2016-11-17 14:00:59 (GMT)
commit242fc738a057ffd884aca2990af4fdd60746fc64 (patch)
tree33c61b21315db39f40609033a9e22d086acca663 /tests
parent5e785a679269e7f24cd3e973bd1660066a4a8444 (diff)
downloadhostap-242fc738a057ffd884aca2990af4fdd60746fc64.zip
hostap-242fc738a057ffd884aca2990af4fdd60746fc64.tar.gz
hostap-242fc738a057ffd884aca2990af4fdd60746fc64.tar.bz2
tests: GAS/ANQP and Capability List ANQP-element
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_gas.py38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/hwsim/test_gas.py b/tests/hwsim/test_gas.py
index 6e73163..e72e1ef 100644
--- a/tests/hwsim/test_gas.py
+++ b/tests/hwsim/test_gas.py
@@ -1518,3 +1518,41 @@ def test_gas_anqp_venue_url(dev, apdev):
ids = struct.pack('<HHH', 257, 258, 277)
if not bss['anqp_capability_list'].startswith(binascii.hexlify(ids)):
raise Exception("Unexpected Capability List ANQP-element value: " + bss['anqp_capability_list'])
+
+def test_gas_anqp_capab_list(dev, apdev):
+ """GAS/ANQP and Capability List ANQP-element"""
+ params = { "ssid": "gas/anqp",
+ "interworking": "1" }
+ params["anqp_elem"] = []
+ for i in range(0, 400):
+ if i not in [ 257 ]:
+ params["anqp_elem"] += [ "%d:010203" % i ]
+ hapd = hostapd.add_ap(apdev[0], params)
+ bssid = apdev[0]['bssid']
+
+ dev[0].scan_for_bss(bssid, freq="2412", force_scan=True)
+ if "OK" not in dev[0].request("ANQP_GET " + bssid + " 257"):
+ raise Exception("ANQP_GET command failed")
+
+ ev = dev[0].wait_event(["GAS-QUERY-DONE"], timeout=10)
+ if ev is None:
+ raise Exception("GAS query timed out")
+
+ bss = dev[0].get_bss(bssid)
+
+ if 'anqp_capability_list' not in bss:
+ raise Exception("Capability List ANQP-element not seen")
+ val = bss['anqp_capability_list']
+ logger.info("anqp_capability_list: " + val)
+ ids = []
+ while len(val) >= 4:
+ id_bin = binascii.unhexlify(val[0:4])
+ id = struct.unpack('<H', id_bin)[0]
+ if id == 0xdddd:
+ break
+ ids.append(id)
+ val = val[4:]
+ logger.info("InfoIDs: " + str(ids))
+ for i in range(257, 300):
+ if i not in ids:
+ raise Exception("Unexpected Capability List ANQP-element value (missing %d): %s" % (i, bss['anqp_capability_list']))