]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: P2P_STOP_FIND/P2P_FLUSH to ignore new results
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 30 Oct 2014 18:01:21 +0000 (20:01 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 30 Oct 2014 22:50:01 +0000 (00:50 +0200)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_p2p_discovery.py

index ad0d0bff9c37d7840b1ff2be8a5869d3d8cbbcb3..2071e2427e399cf6d6a59942b3e690f9a84bb72c 100644 (file)
@@ -327,3 +327,34 @@ def test_discovery_auto(dev):
         raise Exception("Dev1 not in provision discovery event")
     if "peer_go=1" not in ev0:
         raise Exception("peer_go incorrect in PD response from GO")
+
+def test_discovery_stop(dev):
+    """P2P device discovery and p2p_stop_find"""
+    addr0 = dev[0].p2p_dev_addr()
+    addr1 = dev[1].p2p_dev_addr()
+    dev[1].p2p_listen()
+    dev[2].p2p_listen()
+
+    dev[0].p2p_find(social=False)
+    ev = dev[0].wait_event(["CTRL-EVENT-SCAN-STARTED"], timeout=0.5)
+    if ev is None:
+        logger.info("No CTRL-EVENT-SCAN-STARTED event")
+    dev[0].p2p_stop_find()
+    ev = dev[0].wait_global_event(["P2P-FIND-STOPPED"], timeout=1)
+    if ev is None:
+        raise Exception("P2P_STOP not reported")
+    ev = dev[0].wait_global_event(["P2P-DEVICE-FOUND"], timeout=5)
+    if ev is not None:
+        raise Exception("Peer found unexpectedly: " + ev)
+
+    dev[0].p2p_find(social=False)
+    ev = dev[0].wait_event(["CTRL-EVENT-SCAN-STARTED"], timeout=0.5)
+    if ev is None:
+        logger.info("No CTRL-EVENT-SCAN-STARTED event")
+    dev[0].request("P2P_FLUSH")
+    ev = dev[0].wait_global_event(["P2P-FIND-STOPPED"], timeout=1)
+    if ev is None:
+        raise Exception("P2P_STOP not reported")
+    ev = dev[0].wait_global_event(["P2P-DEVICE-FOUND"], timeout=5)
+    if ev is not None:
+        raise Exception("Peer found unexpectedly: " + ev)