From: Jouni Malinen Date: Wed, 10 Dec 2014 21:35:29 +0000 (+0200) Subject: tests: Additional P2P_PRESENCE_REQ coverage X-Git-Tag: hostap_2_4~836 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf1b59731af64feb51cb63a4fd05b6c16b695562;p=thirdparty%2Fhostap.git tests: Additional P2P_PRESENCE_REQ coverage Signed-off-by: Jouni Malinen --- diff --git a/tests/hwsim/test_p2p_autogo.py b/tests/hwsim/test_p2p_autogo.py index 59e0c1237..20f43cb28 100644 --- a/tests/hwsim/test_p2p_autogo.py +++ b/tests/hwsim/test_p2p_autogo.py @@ -56,9 +56,23 @@ def test_autogo(dev): raise Exception("P2P flag missing from scan results: " + res) # Presence request to increase testing coverage + if "FAIL" not in dev[1].group_request("P2P_PRESENCE_REQ 30000"): + raise Exception("Invald P2P_PRESENCE_REQ accepted") + if "FAIL" not in dev[1].group_request("P2P_PRESENCE_REQ 30000 102400 30001"): + raise Exception("Invald P2P_PRESENCE_REQ accepted") if "FAIL" in dev[1].group_request("P2P_PRESENCE_REQ 30000 102400"): raise Exception("Could not send presence request") ev = dev[1].wait_event(["P2P-PRESENCE-RESPONSE"]) + if ev is None: + raise Exception("Timeout while waiting for Presence Response") + if "FAIL" in dev[1].group_request("P2P_PRESENCE_REQ 30000 102400 20000 102400"): + raise Exception("Could not send presence request") + ev = dev[1].wait_event(["P2P-PRESENCE-RESPONSE"]) + if ev is None: + raise Exception("Timeout while waiting for Presence Response") + if "FAIL" in dev[1].group_request("P2P_PRESENCE_REQ"): + raise Exception("Could not send presence request") + ev = dev[1].wait_event(["P2P-PRESENCE-RESPONSE"]) if ev is None: raise Exception("Timeout while waiting for Presence Response")