tests: Hotspot 2.0 OSU provider and single SSID
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
This commit is contained in:
parent
075926ec71
commit
40d514ec64
1 changed files with 51 additions and 0 deletions
|
@ -3099,6 +3099,57 @@ def test_ap_hs20_fetch_osu_no_icon(dev, apdev):
|
||||||
os.remove(dir + "/" + f)
|
os.remove(dir + "/" + f)
|
||||||
os.rmdir(dir)
|
os.rmdir(dir)
|
||||||
|
|
||||||
|
def test_ap_hs20_fetch_osu_single_ssid(dev, apdev):
|
||||||
|
"""Hotspot 2.0 OSU provider and single SSID"""
|
||||||
|
bssid = apdev[0]['bssid']
|
||||||
|
params = hs20_ap_params()
|
||||||
|
params['hs20_icon'] = "128:80:zxx:image/png:w1fi_logo:w1fi_logo-no-file.png"
|
||||||
|
params['osu_ssid'] = '"HS 2.0 OSU open"'
|
||||||
|
params['osu_method_list'] = "1"
|
||||||
|
params['osu_friendly_name'] = [ "eng:Test OSU", "fin:Testi-OSU" ]
|
||||||
|
params['osu_icon'] = "w1fi_logo"
|
||||||
|
params['osu_service_desc'] = [ "eng:Example services", "fin:Esimerkkipalveluja" ]
|
||||||
|
params['osu_server_uri'] = "https://example.com/osu/"
|
||||||
|
params['wpa_key_mgmt'] = "WPA-EAP OSEN"
|
||||||
|
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")
|
||||||
|
osu_ssid = False
|
||||||
|
osu_ssid2 = False
|
||||||
|
with open(os.path.join(dir, "osu-providers.txt"), "r") as f:
|
||||||
|
for l in f.readlines():
|
||||||
|
logger.info(l.strip())
|
||||||
|
if l.strip() == "osu_ssid=HS 2.0 OSU open":
|
||||||
|
osu_ssid = True
|
||||||
|
if l.strip() == "osu_ssid2=test-hs20":
|
||||||
|
osu_ssid2 = True
|
||||||
|
if not osu_ssid:
|
||||||
|
raise Exception("osu_ssid not reported")
|
||||||
|
if not osu_ssid2:
|
||||||
|
raise Exception("osu_ssid2 not reported")
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in a new issue