1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-31 05:47:43 +03:00

testlib.py: Correct dbus signature verification

This allows us to fully verify introspection data matches what we are
getting.
This commit is contained in:
Tony Asleson 2019-10-09 16:53:34 -05:00
parent 5971da2c72
commit ed7e365ae5

View File

@ -145,6 +145,8 @@ def btsr(value):
return rc
elif t == dbus.Array:
rc = "a"
if hasattr(value, "signature"):
return rc + value.signature
for i in value:
rc += btsr(i)
break
@ -157,12 +159,9 @@ def verify_type(value, dbus_str_rep):
actual_str_rep = btsr(value)
if dbus_str_rep != actual_str_rep:
# print("%s ~= %s" % (dbus_str_rep, actual_str_rep))
# Unless we have a full filled out type we won't match exactly
if not dbus_str_rep.startswith(actual_str_rep):
raise RuntimeError(
"Incorrect type, expected= %s actual = %s object= %s" %
(dbus_str_rep, actual_str_rep, str(type(value))))
raise RuntimeError(
"Incorrect type, expected= %s actual = %s object= %s" %
(dbus_str_rep, actual_str_rep, str(type(value))))
class RemoteInterface(object):