tests: Hotspot 2.0 OSU provider and no AP with info

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2016-07-03 22:08:31 +03:00
parent 3429e2ff36
commit c8fa30f213

View File

@ -2607,6 +2607,36 @@ def test_ap_hs20_fetch_osu(dev, apdev):
if "FAIL" not in dev[i].request("DEL_HS20_ICON "): if "FAIL" not in dev[i].request("DEL_HS20_ICON "):
raise Exception("DEL_HS20_ICON accepted when no icons left") raise Exception("DEL_HS20_ICON accepted when no icons left")
def test_ap_hs20_fetch_osu_no_info(dev, apdev):
"""Hotspot 2.0 OSU provider and no AP with info"""
bssid = apdev[0]['bssid']
params = hs20_ap_params()
hostapd.add_ap(apdev[0], params)
dev[0].hs20_enable()
dir = "/tmp/osu-fetch"
if os.path.isdir(dir):
files = [ f for f in os.listdir(dir) if f.startswith("osu-") ]
for f in files:
os.remove(dir + "/" + f)
else:
try:
os.makedirs(dir)
except:
pass
dev[0].scan_for_bss(bssid, freq="2412")
try:
dev[0].request("SET osu_dir " + dir)
dev[0].request("FETCH_OSU")
ev = dev[0].wait_event(["OSU provider fetch completed"], timeout=30)
if ev is None:
raise Exception("Timeout on OSU fetch")
finally:
files = [ f for f in os.listdir(dir) if f.startswith("osu-") ]
for f in files:
os.remove(dir + "/" + f)
os.rmdir(dir)
def get_icon(dev, bssid, iconname): def get_icon(dev, bssid, iconname):
icon = "" icon = ""
pos = 0 pos = 0