From ce438369653a0a4b0ff2eda13cfea7ff706dd3ce Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 31 Dec 2015 00:06:06 +0200 Subject: [PATCH] tests: GO Negotiation stopped after TX start This verifies that P2P_STOP_FIND stops a pending offchannel TX wait in the kernel by checking that a listen operation can be started in less than a second after stopping a pending Action frame TX. This verifies that the optimization introduced in the previous commit works properly. Signed-off-by: Jouni Malinen --- tests/hwsim/test_p2p_grpform.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/hwsim/test_p2p_grpform.py b/tests/hwsim/test_p2p_grpform.py index bd42792b5..f13f0a3e2 100644 --- a/tests/hwsim/test_p2p_grpform.py +++ b/tests/hwsim/test_p2p_grpform.py @@ -1099,3 +1099,21 @@ def test_grpform_go_neg_dup_on_restart(dev): lower.dump_monitor() higher.dump_monitor() + +def test_grpform_go_neg_stopped(dev): + """GO Negotiation stopped after TX start""" + addr0 = dev[0].p2p_dev_addr() + dev[0].p2p_listen() + if not dev[1].discover_peer(addr0): + raise Exception("Could not discover peer") + dev[0].p2p_stop_find() + if "OK" not in dev[1].request("P2P_CONNECT %s pbc" % addr0): + raise Exception("Could not request GO Negotiation") + dev[1].p2p_stop_find() + dev[1].p2p_listen() + dev[0].p2p_find(social=True) + ev = dev[0].wait_global_event(["P2P-DEVICE-FOUND"], timeout=1.2) + dev[0].p2p_stop_find() + dev[1].p2p_stop_find() + if ev is None: + raise Exception("Did not find peer quickly enough after stopped P2P_CONNECT")