aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-01-01 17:56:24 (GMT)
committerJouni Malinen <j@w1.fi>2014-01-01 17:56:24 (GMT)
commit8fdcca345226fafe063304b831faeed45d0f21b2 (patch)
tree2e01cbf97a85ec906dc4c5475a4e1eb5a5b9b47d
parent34d35be44b40fa7bc8bbdac691dd5dc2d79f85f0 (diff)
downloadhostap-8fdcca345226fafe063304b831faeed45d0f21b2.zip
hostap-8fdcca345226fafe063304b831faeed45d0f21b2.tar.gz
hostap-8fdcca345226fafe063304b831faeed45d0f21b2.tar.bz2
tests: Verify P2P SD request cancel
Signed-hostap: Jouni Malinen <j@w1.fi>
-rw-r--r--tests/hwsim/test_p2p_service.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/hwsim/test_p2p_service.py b/tests/hwsim/test_p2p_service.py
index bfab78d..aa57c2c 100644
--- a/tests/hwsim/test_p2p_service.py
+++ b/tests/hwsim/test_p2p_service.py
@@ -122,3 +122,20 @@ def test_p2p_service_discovery_ws(dev):
raise Exception("Unexpected service discovery response contents (UPnP not expected)")
if "0300030101" not in ev:
raise Exception("Unexpected service discovery response contents (WS)")
+
+def test_p2p_service_discovery_req_cancel(dev):
+ """Cancel a P2P service discovery request"""
+ if "FAIL" not in dev[0].request("P2P_SERV_DISC_CANCEL_REQ ab"):
+ raise Exception("Unexpected SD cancel success")
+ query = dev[0].request("P2P_SERV_DISC_REQ " + dev[1].p2p_dev_addr() + " 02000001")
+ if "OK" not in dev[0].request("P2P_SERV_DISC_CANCEL_REQ " + query):
+ raise Exception("Unexpected SD cancel failure")
+ query1 = dev[0].request("P2P_SERV_DISC_REQ " + dev[1].p2p_dev_addr() + " 02000001")
+ query2 = dev[0].request("P2P_SERV_DISC_REQ " + dev[1].p2p_dev_addr() + " 02000002")
+ query3 = dev[0].request("P2P_SERV_DISC_REQ " + dev[1].p2p_dev_addr() + " 02000003")
+ if "OK" not in dev[0].request("P2P_SERV_DISC_CANCEL_REQ " + query2):
+ raise Exception("Unexpected SD cancel failure")
+ if "OK" not in dev[0].request("P2P_SERV_DISC_CANCEL_REQ " + query1):
+ raise Exception("Unexpected SD cancel failure")
+ if "OK" not in dev[0].request("P2P_SERV_DISC_CANCEL_REQ " + query3):
+ raise Exception("Unexpected SD cancel failure")