From 474d209057fd4bd2ece801c3c515b6e01b83f9ad Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 1 Jan 2014 20:01:00 +0200 Subject: [PATCH] tests: P2P SD using per-peer query Signed-hostap: Jouni Malinen --- tests/hwsim/test_p2p_service.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/tests/hwsim/test_p2p_service.py b/tests/hwsim/test_p2p_service.py index aa57c2cd1..8faefdc86 100644 --- a/tests/hwsim/test_p2p_service.py +++ b/tests/hwsim/test_p2p_service.py @@ -62,21 +62,23 @@ def run_sd(dev, dst, query, exp_query=None, fragment=False): def test_p2p_service_discovery(dev): """P2P service discovery""" - ev = run_sd(dev, "00:00:00:00:00:00", "02000001") - 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_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: + for dst in [ "00:00:00:00:00:00", dev[0].p2p_dev_addr() ]: + ev = run_sd(dev, dst, "02000001") 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_fragmentation(dev): + """P2P service discovery with fragmentation""" + for dst in [ "00:00:00:00:00:00", dev[0].p2p_dev_addr() ]: + ev = run_sd(dev, dst, "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): """P2P service discovery (Bonjour)""" ev = run_sd(dev, "00:00:00:00:00:00", "02000101")