tests: P2P cancel join-group using p2pdev and no separate group interface

Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
Jouni Malinen 2019-01-01 16:58:11 +02:00
parent dc9b7d217c
commit 2994ecfb5f

View file

@ -433,6 +433,29 @@ def test_p2p_device_join_no_group_iface(dev, apdev):
terminate_group(dev[0], wpas)
def test_p2p_device_join_no_group_iface_cancel(dev, apdev):
"""P2P cancel join-group 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 = dev[0].p2p_start_go()
bssid = dev[0].get_group_status_field('bssid')
wpas.scan_for_bss(bssid, res['freq'])
pin = wpas.wps_read_pin()
dev[0].p2p_go_authorize_client(pin)
cmd = "P2P_CONNECT %s %s join freq=%s" % (dev[0].p2p_dev_addr(), pin,
res['freq'])
if "OK" not in wpas.request(cmd):
raise Exception("P2P_CONNECT(join) failed")
ev = wpas.wait_event(["CTRL-EVENT-SCAN-STARTED"], timeout=1)
if "OK" not in wpas.request("P2P_CANCEL"):
raise Exception("P2P_CANCEL failed")
dev[0].remove_group()
def test_p2p_device_persistent_group(dev):
"""P2P persistent group formation and re-invocation with cfg80211 P2P Device"""
with HWSimRadio(use_p2p_device=True) as (radio, iface):