tests: P2P service discovery with GAS fragmentation
Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
984c5b96e3
commit
34d35be44b
1 changed files with 17 additions and 1 deletions
|
@ -8,6 +8,7 @@
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
|
import uuid
|
||||||
|
|
||||||
import hwsim_utils
|
import hwsim_utils
|
||||||
|
|
||||||
|
@ -24,11 +25,17 @@ def add_upnp_services(dev):
|
||||||
dev.request("P2P_SERVICE_ADD upnp 10 uuid:5566d33e-9774-09ab-4822-333456785632::urn:schemas-upnp-org:service:ContentDirectory:2")
|
dev.request("P2P_SERVICE_ADD upnp 10 uuid:5566d33e-9774-09ab-4822-333456785632::urn:schemas-upnp-org:service:ContentDirectory:2")
|
||||||
dev.request("P2P_SERVICE_ADD upnp 10 uuid:6859dede-8574-59ab-9332-123456789012::urn:schemas-upnp-org:device:InternetGatewayDevice:1")
|
dev.request("P2P_SERVICE_ADD upnp 10 uuid:6859dede-8574-59ab-9332-123456789012::urn:schemas-upnp-org:device:InternetGatewayDevice:1")
|
||||||
|
|
||||||
def run_sd(dev, dst, query, exp_query=None):
|
def add_extra_services(dev):
|
||||||
|
for i in range(0, 100):
|
||||||
|
dev.request("P2P_SERVICE_ADD upnp 10 uuid:" + str(uuid.uuid4()) + "::upnp:rootdevice")
|
||||||
|
|
||||||
|
def run_sd(dev, dst, query, exp_query=None, fragment=False):
|
||||||
addr0 = dev[0].p2p_dev_addr()
|
addr0 = dev[0].p2p_dev_addr()
|
||||||
addr1 = dev[1].p2p_dev_addr()
|
addr1 = dev[1].p2p_dev_addr()
|
||||||
add_bonjour_services(dev[0])
|
add_bonjour_services(dev[0])
|
||||||
add_upnp_services(dev[0])
|
add_upnp_services(dev[0])
|
||||||
|
if fragment:
|
||||||
|
add_extra_services(dev[0])
|
||||||
dev[0].p2p_listen()
|
dev[0].p2p_listen()
|
||||||
|
|
||||||
dev[1].request("P2P_FLUSH")
|
dev[1].request("P2P_FLUSH")
|
||||||
|
@ -61,6 +68,15 @@ def test_p2p_service_discovery(dev):
|
||||||
if "496e7465726e6574" not in ev:
|
if "496e7465726e6574" not in ev:
|
||||||
raise Exception("Unexpected service discovery response contents (UPnP)")
|
raise Exception("Unexpected service discovery response contents (UPnP)")
|
||||||
|
|
||||||
|
def test_p2p_service_discovery_fragmentation(dev):
|
||||||
|
"""P2P service discovery with fragmentation"""
|
||||||
|
ev = run_sd(dev, "00:00:00:00:00:00", "02000001", fragment=True)
|
||||||
|
if not "long response" in ev:
|
||||||
|
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)")
|
||||||
|
|
||||||
def test_p2p_service_discovery_bonjour(dev):
|
def test_p2p_service_discovery_bonjour(dev):
|
||||||
"""P2P service discovery (Bonjour)"""
|
"""P2P service discovery (Bonjour)"""
|
||||||
ev = run_sd(dev, "00:00:00:00:00:00", "02000101")
|
ev = run_sd(dev, "00:00:00:00:00:00", "02000101")
|
||||||
|
|
Loading…
Reference in a new issue