From fde43cddb9ba7bf70e075f01030441ca069e40ab Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 30 Mar 2013 20:31:22 +0200 Subject: [PATCH] tests: Fix test_discovery to force full device discovery P2P_PROV_DISC fails if the peer is not fully discovered and the previous version of the test cases did not force this (i.e., it could have started PD just based on having seen a Probe Request frame from the peer). Signed-hostap: Jouni Malinen --- tests/hwsim/test_p2p_discovery.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/tests/hwsim/test_p2p_discovery.py b/tests/hwsim/test_p2p_discovery.py index f53e8539b..0b0c7beb4 100644 --- a/tests/hwsim/test_p2p_discovery.py +++ b/tests/hwsim/test_p2p_discovery.py @@ -17,19 +17,10 @@ def test_discovery(dev): addr1 = dev[1].p2p_dev_addr() logger.info("Start device discovery") dev[0].p2p_find(social=True) - dev[1].p2p_find(social=True) - ev0 = dev[0].wait_event(["P2P-DEVICE-FOUND"], timeout=15) - if ev0 is None: + if not dev[1].discover_peer(addr0): raise Exception("Device discovery timed out") - ev1 = dev[1].wait_event(["P2P-DEVICE-FOUND"], timeout=15) - if ev1 is None: + if not dev[0].discover_peer(addr1): raise Exception("Device discovery timed out") - dev[0].dump_monitor() - dev[1].dump_monitor() - if addr1 not in ev0: - raise Exception("Dev1 not found properly") - if addr0 not in ev1: - raise Exception("Dev0 not found properly") logger.info("Test provision discovery for display") dev[0].request("P2P_PROV_DISC " + addr1 + " display")