From: Jouni Malinen Date: Tue, 1 Jan 2019 14:58:11 +0000 (+0200) Subject: tests: P2P cancel join-group using p2pdev and no separate group interface X-Git-Tag: hostap_2_8~641 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2994ecfb5f0a2585f52c628231a5745b2a3026e5;p=thirdparty%2Fhostap.git tests: P2P cancel join-group using p2pdev and no separate group interface Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_p2p_device.py b/tests/hwsim/test_p2p_device.py index c239b655d..bd2a7633c 100644 --- a/tests/hwsim/test_p2p_device.py +++ b/tests/hwsim/test_p2p_device.py @@ -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):