mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
tests: Hotspot 2.0 OSU provider and no AP with info
Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
3429e2ff36
commit
c8fa30f213
@ -2607,6 +2607,36 @@ def test_ap_hs20_fetch_osu(dev, apdev):
|
||||
if "FAIL" not in dev[i].request("DEL_HS20_ICON "):
|
||||
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):
|
||||
icon = ""
|
||||
pos = 0
|
||||
|
Loading…
Reference in New Issue
Block a user