tests: P2P autogo using cfg80211 P2P Device

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2016-02-26 18:36:44 +02:00 committed by Jouni Malinen
parent 2335511463
commit b17f8f1722

View file

@ -360,3 +360,34 @@ def test_p2p_device_grpform_timeout_go(dev, apdev):
del wpas del wpas
if "p2p-" + iface + "-" in ifaces: if "p2p-" + iface + "-" in ifaces:
raise Exception("Group interface still present after failure") raise Exception("Group interface still present after failure")
def test_p2p_device_autogo(dev, apdev):
"""P2P autogo using cfg80211 P2P Device"""
with HWSimRadio(use_p2p_device=True) as (radio, iface):
wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
wpas.interface_add(iface)
res = wpas.p2p_start_go()
if not res['ifname'].startswith('p2p-' + iface):
raise Exception("Unexpected group ifname: " + res['ifname'])
bssid = wpas.get_group_status_field('bssid')
dev[0].scan_for_bss(bssid, res['freq'])
connect_cli(wpas, dev[0], freq=res['freq'])
terminate_group(wpas, dev[0])
def test_p2p_device_autogo_no_group_iface(dev, apdev):
"""P2P autogo using cfg80211 P2P Device (no separate group interface)"""
with HWSimRadio(use_p2p_device=True) as (radio, iface):
wpas = WpaSupplicant(global_iface='/tmp/wpas-wlan5')
wpas.interface_add(iface)
wpas.global_request("SET p2p_no_group_iface 1")
res = wpas.p2p_start_go()
if res['ifname'] != iface:
raise Exception("Unexpected group ifname: " + res['ifname'])
bssid = wpas.get_group_status_field('bssid')
dev[0].scan_for_bss(bssid, res['freq'])
connect_cli(wpas, dev[0], freq=res['freq'])
terminate_group(wpas, dev[0])