[libvirt-python PATCH v3 1/3] test: workaround missing VIR_TYPED_PARAM enums in API definition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Ubuntu 18.04 with libvirt 4.0.0 libvirt-python build fails

running test
/usr/bin/python3 sanitytest.py build/lib.linux-x86_64-3.6 /usr/share/libvirt/api/libvirt-api.xml
Cannot get a value of enum VIR_TYPED_PARAM_BOOLEAN (originally VIR_DOMAIN_BLKIO_PARAM_BOOLEAN)
Cannot get a value of enum VIR_TYPED_PARAM_DOUBLE (originally VIR_DOMAIN_BLKIO_PARAM_DOUBLE)
Cannot get a value of enum VIR_TYPED_PARAM_INT (originally VIR_DOMAIN_BLKIO_PARAM_INT)
...snip...

The code generated for the binding is still correct and so we can just
whitelist this error scenario.

Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
---
 sanitytest.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/sanitytest.py b/sanitytest.py
index 1bedd55..f187c15 100644
--- a/sanitytest.py
+++ b/sanitytest.py
@@ -73,7 +73,11 @@ for n in second_pass:
             val = int(v[val])
             break
 
-    if type(val) != int:
+    # Version 4.0.0 was broken as missing VIR_TYPED_PARAM enums
+    # constants. This is harmless from POV of validating API
+    # coverage so ignore this error.
+    if (type(val) != int and
+        not val.startswith("VIR_TYPED_PARAM_")):
         fail = True
         print("Cannot get a value of enum %s (originally %s)" % (val, name))
     enumvals[typ][name] = val
-- 
2.25.4





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux