]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: P2P SD with GO
authorJouni Malinen <jouni@qca.qualcomm.com>
Tue, 21 Oct 2014 09:08:47 +0000 (12:08 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 21 Oct 2014 20:32:17 +0000 (23:32 +0300)
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
tests/hwsim/test_p2p_service.py

index 4497dbea3b9e7dfbb2d60e3f3a7c25356b31d50e..4fdcb2a0b1e0c4bbd99c694a850d179a9db1f778 100644 (file)
@@ -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)")