From: Jouni Malinen Date: Fri, 19 Dec 2014 21:17:06 +0000 (+0200) Subject: tests: P2P_LISTEN and scan X-Git-Tag: hostap_2_4~743 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed930f064c7ccb8956c1a3ba8a95e19264c78940;p=thirdparty%2Fhostap.git tests: P2P_LISTEN and scan Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_p2p_discovery.py b/tests/hwsim/test_p2p_discovery.py index 42eaf77bf..475e30f13 100644 --- a/tests/hwsim/test_p2p_discovery.py +++ b/tests/hwsim/test_p2p_discovery.py @@ -423,3 +423,16 @@ def test_p2p_listen_and_offchannel_tx(dev): raise Exception("Device discovery timed out after PD exchange") dev[2].p2p_stop_find() dev[0].p2p_stop_find() + +def test_p2p_listen_and_scan(dev): + """P2P_LISTEN and scan""" + dev[0].p2p_listen() + if "OK" not in dev[0].request("SCAN freq=2412"): + raise Exception("Failed to request a scan") + ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 3) + if ev is not None: + raise Exception("Unexpected scan results") + dev[0].p2p_stop_find() + ev = dev[0].wait_event(["CTRL-EVENT-SCAN-RESULTS"], 15) + if ev is None: + raise Exception("Scan timed out")