aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2014-10-30 18:01:21 (GMT)
committerJouni Malinen <j@w1.fi>2014-10-30 22:50:01 (GMT)
commit70892f697f182e9eac2eda2bc6fbb7f223f4ff9b (patch)
tree1b5a6b2fcbea18f6f661b7ad5a9645deea6e7739 /tests
parent477b082cc4e9cb2025dba83bab6f9eed47eefc05 (diff)
downloadhostap-70892f697f182e9eac2eda2bc6fbb7f223f4ff9b.zip
hostap-70892f697f182e9eac2eda2bc6fbb7f223f4ff9b.tar.gz
hostap-70892f697f182e9eac2eda2bc6fbb7f223f4ff9b.tar.bz2
tests: P2P_STOP_FIND/P2P_FLUSH to ignore new results
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_p2p_discovery.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/hwsim/test_p2p_discovery.py b/tests/hwsim/test_p2p_discovery.py
index ad0d0bf..2071e24 100644
--- a/tests/hwsim/test_p2p_discovery.py
+++ b/tests/hwsim/test_p2p_discovery.py
@@ -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)