Pino Toscano
2018-Oct-01 14:40 UTC
[Libguestfs] [PATCH v2] v2v: -o rhv-upload: test-v2v-o-rhv-upload.sh: add more skip checks
-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" -- 2.17.1
Richard W.M. Jones
2018-Oct-01 14:53 UTC
Re: [Libguestfs] [PATCH v2] v2v: -o rhv-upload: test-v2v-o-rhv-upload.sh: add more skip checks
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
Pino Toscano
2018-Oct-01 17:09 UTC
Re: [Libguestfs] [PATCH v2] v2v: -o rhv-upload: test-v2v-o-rhv-upload.sh: add more skip checks
On Monday, 1 October 2018 16:53:12 CEST Richard W.M. Jones wrote:> 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.Yes, that is why I added the check there, as it matches the current implementation in -o rhv-upload. (TBH, there is a small flaw there, albeit with no actual changes: the name of the Python interpreter is used also as the name of the nbdkit plugin, which again is the case only on Fedora.) -- Pino Toscano
Apparently Analagous Threads
- [PATCH] v2v: -o rhv-upload: skip test-v2v-o-rhv-upload.sh w/o nbdkit
- [v2v PATCH 0/3] tests: simpler way to use configure results
- Re: [PATCH v2] v2v: -o rhv-upload: test-v2v-o-rhv-upload.sh: add more skip checks
- Re: [PATCH] v2v: -o rhv-upload: skip test-v2v-o-rhv-upload.sh w/o nbdkit
- [PATCH] tests: rhv-upload: Require nbdkit python plugin