From e56e286d00c4b2f6ebec99d73667a04b168cde50 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Tue, 25 Mar 2014 18:08:52 +0200 Subject: [PATCH] tests: GAS/ANQP query for both IEEE 802.11 and Hotspot 2.0 elements Signed-off-by: Jouni Malinen --- tests/hwsim/test_gas.py | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/hwsim/test_gas.py b/tests/hwsim/test_gas.py index 5b790a702..892dfe44a 100644 --- a/tests/hwsim/test_gas.py +++ b/tests/hwsim/test_gas.py @@ -221,6 +221,38 @@ def test_gas_comeback_delay(dev, apdev): if ev is None: raise Exception("Operation timed out") +def test_gas_anqp_get(dev, apdev): + """GAS/ANQP query for both IEEE 802.11 and Hotspot 2.0 elements""" + hapd = start_ap(apdev[0]) + bssid = apdev[0]['bssid'] + + dev[0].scan(freq="2412") + dev[0].request("ANQP_GET " + bssid + " 258,268,hs20:3,hs20:4") + + ev = dev[0].wait_event(["GAS-QUERY-START"], timeout=5) + if ev is None: + raise Exception("GAS query start timed out") + + ev = dev[0].wait_event(["GAS-QUERY-DONE"], timeout=10) + if ev is None: + raise Exception("GAS query timed out") + + ev = dev[0].wait_event(["RX-ANQP"], timeout=1) + if ev is None or "Venue Name" not in ev: + raise Exception("Did not receive Venue Name") + + ev = dev[0].wait_event(["RX-ANQP"], timeout=1) + if ev is None or "Domain Name list" not in ev: + raise Exception("Did not receive Domain Name list") + + ev = dev[0].wait_event(["RX-HS20-ANQP"], timeout=1) + if ev is None or "Operator Friendly Name" not in ev: + raise Exception("Did not receive Operator Friendly Name") + + ev = dev[0].wait_event(["RX-HS20-ANQP"], timeout=1) + if ev is None or "WAN Metrics" not in ev: + raise Exception("Did not receive WAN Metrics") + def expect_gas_result(dev, result, status=None): ev = dev.wait_event(["GAS-QUERY-DONE"], timeout=10) if ev is None: