[Libguestfs] [PATCH v2] v2v: -o rhv-upload: test-v2v-o-rhv-upload.sh: add more skip checks

Richard W.M. Jones rjones at redhat.com
Mon Oct 1 14:53:12 UTC 2018


On Mon, Oct 01, 2018 at 04:40:19PM +0200, Pino Toscano wrote:
> -o rhv-upload requires python3, and nbdkit with the python3 plugin, so
> skip this test if they are not installed.
> ---
> 
> v1 is:
> https://www.redhat.com/archives/libguestfs/2018-October/msg00008.html
> 
>  v2v/test-v2v-o-rhv-upload.sh | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/v2v/test-v2v-o-rhv-upload.sh b/v2v/test-v2v-o-rhv-upload.sh
> index 8bda7cc0b..23d2ad7a0 100755
> --- a/v2v/test-v2v-o-rhv-upload.sh
> +++ b/v2v/test-v2v-o-rhv-upload.sh
> @@ -28,6 +28,8 @@ set -x
>  $TEST_FUNCTIONS
>  skip_if_skipped
>  skip_if_backend uml
> +skip_unless python3 --version
> +skip_unless nbdkit python3 --version
>  skip_unless_phony_guest windows.img
>  
>  libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml"

This will only work on Fedora because Fedora renames the upstream
nbdkit python plugin to nbdkit-python3-plugin.so:

https://src.fedoraproject.org/rpms/nbdkit/blob/master/f/nbdkit.spec#_679

However that's (sort of) OK since our current implementation of
-o rhv-upload *also* assumes the plugin has been renamed.

TBH I've no idea what's going to happen in future.  Maybe once Python2
is dead we will remove the above renaming in Fedora and there will
only be a single plugin called nbdkit-python-plugin.so.  Or maybe we
will keep a compatibility symlink around.

I think the Python community didn't learn a lesson here and one day
might try to break things again with Python 4, which would be very
unfortunate.

In any case, ACK.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
Fedora Windows cross-compiler. Compile Windows programs, test, and
build Windows installers. Over 100 libraries supported.
http://fedoraproject.org/wiki/MinGW




More information about the Libguestfs mailing list