]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: P2P cancel join-group using p2pdev and no separate group interface
authorJouni Malinen <j@w1.fi>
Tue, 1 Jan 2019 14:58:11 +0000 (16:58 +0200)
committerJouni Malinen <j@w1.fi>
Tue, 1 Jan 2019 14:58:11 +0000 (16:58 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_p2p_device.py

index c239b655dd504aac0776da9729726ffd28a03c0f..bd2a7633c4bff3e1e42c6de5de02390d6f5bbb07 100644 (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):