]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: HS20_ICON_REQUEST
authorJouni Malinen <j@w1.fi>
Fri, 11 Apr 2014 21:27:20 +0000 (00:27 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 13 Apr 2014 07:26:52 +0000 (10:26 +0300)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_ap_hs20.py

index d2d1af2b36bb40fc09bce469704b1f204da663f4..7cf168c9a5eed0c87ff2d2825ed2617de1ad9182 100644 (file)
@@ -1814,8 +1814,11 @@ def test_ap_hs20_fetch_osu(dev, apdev):
         except:
             pass
     try:
+        dev[1].scan(freq="2412")
         dev[0].request("SET osu_dir " + dir)
         dev[0].request("FETCH_OSU")
+        if "OK" not in dev[1].request("HS20_ICON_REQUEST " + bssid + " w1fi_logo"):
+            raise Exception("HS20_ICON_REQUEST failed")
         icons = 0
         while True:
             ev = dev[0].wait_event(["OSU provider fetch completed",
@@ -1844,3 +1847,17 @@ def test_ap_hs20_fetch_osu(dev, apdev):
 
     if icons != 2:
         raise Exception("Unexpected number of icons fetched")
+
+    ev = dev[1].wait_event(["GAS-QUERY-START"], timeout=5)
+    if ev is None:
+        raise Exception("Timeout on GAS-QUERY-DONE")
+    ev = dev[1].wait_event(["GAS-QUERY-DONE"], timeout=5)
+    if ev is None:
+        raise Exception("Timeout on GAS-QUERY-DONE")
+    if "freq=2412 status_code=0 result=SUCCESS" not in ev:
+        raise Exception("Unexpected GAS-QUERY-DONE: " + ev)
+    ev = dev[1].wait_event(["RX-HS20-ANQP"], timeout=15)
+    if ev is None:
+        raise Exception("Timeout on icon fetch")
+    if "Icon Binary File" not in ev:
+        raise Exception("Unexpected ANQP element")