]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
tests: D-Bus P2P peer information - VSIE
authorJouni Malinen <j@w1.fi>
Wed, 2 Jan 2019 11:00:33 +0000 (13:00 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 2 Jan 2019 11:00:57 +0000 (13:00 +0200)
Signed-off-by: Jouni Malinen <j@w1.fi>
tests/hwsim/test_dbus.py

index ac460230d9ab3e4619eb93b3567a42adbad3ea0b..3baca4c54a94178d313d07a04b152d2906d00f57 100644 (file)
@@ -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: