From 6a94fdf21aa67230a7f330574bc447cd730b9902 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Wed, 2 Jan 2019 13:00:33 +0200 Subject: [PATCH] tests: D-Bus P2P peer information - VSIE Signed-off-by: Jouni Malinen --- tests/hwsim/test_dbus.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py index ac460230d..3baca4c54 100644 --- a/tests/hwsim/test_dbus.py +++ b/tests/hwsim/test_dbus.py @@ -2944,6 +2944,12 @@ def test_dbus_p2p_oom(dev, apdev): def test_dbus_p2p_discovery(dev, apdev): """D-Bus P2P discovery""" + try: + run_dbus_p2p_discovery(dev, apdev) + finally: + dev[1].request("VENDOR_ELEM_REMOVE 1 *") + +def run_dbus_p2p_discovery(dev, apdev): (bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0]) p2p = dbus.Interface(if_obj, WPAS_DBUS_IFACE_P2PDEVICE) @@ -2951,6 +2957,7 @@ def test_dbus_p2p_discovery(dev, apdev): dev[1].request("SET sec_device_type 1-0050F204-2") dev[1].request("VENDOR_ELEM_ADD 1 dd0c0050f2041049000411223344") + dev[1].request("VENDOR_ELEM_ADD 1 dd06001122335566") dev[1].p2p_listen() addr1 = dev[1].p2p_dev_addr() a1 = binascii.unhexlify(addr1.replace(':','')) @@ -3033,6 +3040,14 @@ def test_dbus_p2p_discovery(dev, apdev): if "\x11\x22\x33\x44" not in vendor: raise Exception("Secondary device type mismatch") + if 'VSIE' not in res: + raise Exception("Missing VSIE") + vendor = res['VSIE'] + if len(vendor) < 1: + raise Exception("VSIE missing") + if vendor != "\xdd\x06\x00\x11\x22\x33\x55\x66": + raise Exception("VSIE mismatch") + self.found = True elif res['DeviceAddress'] == a2: if 'IEs' not in res: