aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2014-10-21 09:08:47 (GMT)
committerJouni Malinen <j@w1.fi>2014-10-21 20:32:17 (GMT)
commit81ea400d371020b3d05ac490e1ecd267fefd02e2 (patch)
treefb48dcb539f3638526d13e93d7cbb6fb38d1fb10 /tests
parentccf79ab256f132954b063649227c1bc08d4ec973 (diff)
downloadhostap-81ea400d371020b3d05ac490e1ecd267fefd02e2.zip
hostap-81ea400d371020b3d05ac490e1ecd267fefd02e2.tar.gz
hostap-81ea400d371020b3d05ac490e1ecd267fefd02e2.tar.bz2
tests: P2P SD with GO
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/hwsim/test_p2p_service.py31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/hwsim/test_p2p_service.py b/tests/hwsim/test_p2p_service.py
index 4497dbe..4fdcb2a 100644
--- a/tests/hwsim/test_p2p_service.py
+++ b/tests/hwsim/test_p2p_service.py
@@ -249,3 +249,34 @@ def test_p2p_service_discovery_req_cancel(dev):
query = dev[0].request("P2P_SERV_DISC_REQ 00:00:00:00:00:00 02000001")
if "OK" not in dev[0].request("P2P_SERV_DISC_CANCEL_REQ " + query):
raise Exception("Unexpected SD(broadcast) cancel failure")
+
+def test_p2p_service_discovery_go(dev):
+ """P2P service discovery from GO"""
+ addr0 = dev[0].p2p_dev_addr()
+ addr1 = dev[1].p2p_dev_addr()
+
+ add_bonjour_services(dev[0])
+ add_upnp_services(dev[0])
+
+ dev[0].p2p_start_go(freq=2412)
+
+ dev[1].request("P2P_FLUSH")
+ dev[1].request("P2P_SERV_DISC_REQ " + addr0 + " 02000001")
+ if not dev[1].discover_peer(addr0, social=True, force_find=True):
+ raise Exception("Peer " + addr0 + " not found")
+
+ ev = dev[0].wait_event(["P2P-SERV-DISC-REQ"], timeout=10)
+ if ev is None:
+ raise Exception("Service discovery timed out")
+ if addr1 not in ev:
+ raise Exception("Unexpected service discovery request source")
+
+ ev = dev[1].wait_event(["P2P-SERV-DISC-RESP"], timeout=10)
+ if ev is None:
+ raise Exception("Service discovery timed out")
+ if addr0 not in ev:
+ raise Exception("Unexpected service discovery response source")
+ if "0b5f6166706f766572746370c00c000c01" not in ev:
+ raise Exception("Unexpected service discovery response contents (Bonjour)")
+ if "496e7465726e6574" not in ev:
+ raise Exception("Unexpected service discovery response contents (UPnP)")