Add a single shell script to hold results of configure.
Pino Toscano (3):
build: add an empty config.sh
Revert "tests: rhv-upload: Fix skip test of nbdkit python plugin."
tests: use the right nbdkit python3 plugin
.gitignore | 2 +-
config.sh.in | 22 +++++++++++++++++++
configure.ac | 3 +--
tests/Makefile.am | 1 +
tests/test-functions.sh | 3 +++
...-upload.sh.in => test-v2v-o-rhv-upload.sh} | 3 +--
6 files changed, 29 insertions(+), 5 deletions(-)
create mode 100644 config.sh.in
rename tests/{test-v2v-o-rhv-upload.sh.in => test-v2v-o-rhv-upload.sh} (95%)
--
2.23.0
Show replies by date
This helper script will contain variables with results of configure
checks, so other scripts can source it.
Source it automatically in test-functions.sh, so every test can already
make use of it.
---
.gitignore | 1 +
config.sh.in | 20 ++++++++++++++++++++
configure.ac | 1 +
tests/test-functions.sh | 3 +++
4 files changed, 25 insertions(+)
create mode 100644 config.sh.in
diff --git a/.gitignore b/.gitignore
index ee7e3cf9..54e5b0ec 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,6 +40,7 @@ Makefile.in
/config.h
/config.h.in
/config.log
+/config.sh
/config.status
/config.sub
/configure
diff --git a/config.sh.in b/config.sh.in
new file mode 100644
index 00000000..061871a3
--- /dev/null
+++ b/config.sh.in
@@ -0,0 +1,20 @@
+#!/bin/bash -
+# (C) Copyright 2019 Red Hat Inc.
+# @configure_input@
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# This shell script contains the results of some configure checks,
+# mostly used in other shell scripts.
diff --git a/configure.ac b/configure.ac
index f7ff742a..1b8f6a83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -116,6 +116,7 @@ AC_CONFIG_FILES([Makefile
common/mlxml/Makefile
common/qemuopts/Makefile
common/utils/Makefile
+ config.sh
docs/Makefile
gnulib/lib/Makefile
gnulib/tests/Makefile
diff --git a/tests/test-functions.sh b/tests/test-functions.sh
index 565c4208..446b20fe 100755
--- a/tests/test-functions.sh
+++ b/tests/test-functions.sh
@@ -33,6 +33,9 @@ export LANG=C
# parameters, so we eval those to define the variables.
while [ $# -ge 1 ]; do eval "$1"; shift; done
+# Configure check results.
+source $abs_top_builddir/config.sh
+
# Skip if $SKIP_<script_name> environment variable is set.
# Every test should call this function first.
skip_if_skipped ()
--
2.23.0
It will be fixed in an easier way.
This reverts commit 04bb355d5c581e803585d80e786f5811f2144aac.
---
.gitignore | 1 -
configure.ac | 2 --
tests/Makefile.am | 1 +
.../{test-v2v-o-rhv-upload.sh.in => test-v2v-o-rhv-upload.sh} | 3 +--
4 files changed, 2 insertions(+), 5 deletions(-)
rename tests/{test-v2v-o-rhv-upload.sh.in => test-v2v-o-rhv-upload.sh} (95%)
diff --git a/.gitignore b/.gitignore
index 54e5b0ec..846998b3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -127,7 +127,6 @@ Makefile.in
/test-harness/virt-v2v-test-harness.1
/tests/libvirt-is-version
/tests/test-v2v-conversion-of-*.sh
-/tests/test-v2v-o-rhv-upload.sh
/tests/windows.vmdk
/v2v/.depend
/v2v/config.ml
diff --git a/configure.ac b/configure.ac
index 1b8f6a83..065c6289 100644
--- a/configure.ac
+++ b/configure.ac
@@ -97,8 +97,6 @@ AC_CONFIG_FILES([podwrapper.pl],
[chmod +x,-w podwrapper.pl])
AC_CONFIG_FILES([run],
[chmod +x,-w run])
-AC_CONFIG_FILES([tests/test-v2v-o-rhv-upload.sh],
- [chmod +x,-w tests/test-v2v-o-rhv-upload.sh])
dnl NB: Remove common/mlstdutils/guestfs_config.ml in future XXX
AC_CONFIG_FILES([Makefile
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 0f004d19..3d59eb6a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -88,6 +88,7 @@ TESTS = \
test-v2v-o-openstack.sh \
test-v2v-o-qemu.sh \
test-v2v-o-rhv.sh \
+ test-v2v-o-rhv-upload.sh \
test-v2v-o-vdsm-options.sh \
test-v2v-oa-option.sh \
test-v2v-of-option.sh \
diff --git a/tests/test-v2v-o-rhv-upload.sh.in b/tests/test-v2v-o-rhv-upload.sh
similarity index 95%
rename from tests/test-v2v-o-rhv-upload.sh.in
rename to tests/test-v2v-o-rhv-upload.sh
index 4f2b240e..a2f5b0d5 100755
--- a/tests/test-v2v-o-rhv-upload.sh.in
+++ b/tests/test-v2v-o-rhv-upload.sh
@@ -1,5 +1,4 @@
#!/bin/bash -
-# @configure_input@
# libguestfs virt-v2v test script
# Copyright (C) 2018 Red Hat Inc.
#
@@ -30,7 +29,7 @@ $TEST_FUNCTIONS
skip_if_skipped
skip_if_backend uml
skip_unless python3 --version
-skip_unless nbdkit @VIRT_V2V_NBDKIT_PYTHON_PLUGIN@ --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.23.0
Add the configure result in config.sh, so it can be used as variable.
---
config.sh.in | 2 ++
tests/test-v2v-o-rhv-upload.sh | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/config.sh.in b/config.sh.in
index 061871a3..f3245379 100644
--- a/config.sh.in
+++ b/config.sh.in
@@ -18,3 +18,5 @@
# This shell script contains the results of some configure checks,
# mostly used in other shell scripts.
+
+export VIRT_V2V_NBDKIT_PYTHON_PLUGIN="@VIRT_V2V_NBDKIT_PYTHON_PLUGIN@"
diff --git a/tests/test-v2v-o-rhv-upload.sh b/tests/test-v2v-o-rhv-upload.sh
index a2f5b0d5..e70575c7 100755
--- a/tests/test-v2v-o-rhv-upload.sh
+++ b/tests/test-v2v-o-rhv-upload.sh
@@ -29,7 +29,7 @@ $TEST_FUNCTIONS
skip_if_skipped
skip_if_backend uml
skip_unless python3 --version
-skip_unless nbdkit python3 --version
+skip_unless nbdkit $VIRT_V2V_NBDKIT_PYTHON_PLUGIN --version
skip_unless_phony_guest windows.img
libvirt_uri="test://$abs_top_builddir/test-data/phony-guests/guests.xml"
--
2.23.0