diff options
author | Daniel P. Berrangé <berrange@redhat.com> | 2020-04-29 14:13:48 +0100 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2020-05-01 13:13:13 +0100 |
commit | 7d2715c0ddcfb0794ad84330bbdd35683e474cf9 (patch) | |
tree | 20d117d88a8c91b19e05477d2028972638248a0d | |
parent | 51d434cf0375eeae9f24073fafc09ae69da3110d (diff) | |
download | libvirt-python-7d2715c0ddcfb0794ad84330bbdd35683e474cf9.tar.gz |
test: workaround missing VIR_TYPED_PARAM enums in API definition
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@redhat.com>
-rw-r--r-- | sanitytest.py | 6 |
1 files changed, 5 insertions, 1 deletions
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 |