[Libguestfs] [PATCH 2/2] tests: switch to config.sh for xmllint

Pino Toscano ptoscano at redhat.com
Mon Dec 16 10:20:54 UTC 2019


Instead of generating test scripts from configure with the path of
xmllint, export that path in config.sh, so the tests can be static
scripts again.
---
 .gitignore                                                  | 3 ---
 config.sh.in                                                | 2 ++
 configure.ac                                                | 6 ------
 ...irt-inspector-luks.sh.in => test-virt-inspector-luks.sh} | 2 +-
 .../{test-virt-inspector.sh.in => test-virt-inspector.sh}   | 2 +-
 inspector/{test-xmllint.sh.in => test-xmllint.sh}           | 2 +-
 6 files changed, 5 insertions(+), 12 deletions(-)
 rename inspector/{test-virt-inspector-luks.sh.in => test-virt-inspector-luks.sh} (94%)
 rename inspector/{test-virt-inspector.sh.in => test-virt-inspector.sh} (95%)
 rename inspector/{test-xmllint.sh.in => test-xmllint.sh} (93%)

diff --git a/.gitignore b/.gitignore
index bd8c13954..8dfd2895c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -309,9 +309,6 @@ Makefile.in
 /haskell/Guestfs.hs
 /inspector/actual-*.xml
 /inspector/stamp-virt-inspector.pod
-/inspector/test-virt-inspector.sh
-/inspector/test-virt-inspector-luks.sh
-/inspector/test-xmllint.sh
 /inspector/virt-inspector
 /inspector/virt-inspector.1
 /installcheck.sh
diff --git a/config.sh.in b/config.sh.in
index 061871a3c..c777f096c 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 XMLLINT="@XMLLINT@"
diff --git a/configure.ac b/configure.ac
index 774f78586..64f352323 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,12 +197,6 @@ mkdir -p \
 dnl http://www.mail-archive.com/automake@gnu.org/msg10204.html
 AC_CONFIG_FILES([appliance/libguestfs-make-fixed-appliance],
                 [chmod +x,-w appliance/libguestfs-make-fixed-appliance])
-AC_CONFIG_FILES([inspector/test-xmllint.sh],
-                [chmod +x,-w inspector/test-xmllint.sh])
-AC_CONFIG_FILES([inspector/test-virt-inspector.sh],
-                [chmod +x,-w inspector/test-virt-inspector.sh])
-AC_CONFIG_FILES([inspector/test-virt-inspector-luks.sh],
-                [chmod +x,-w inspector/test-virt-inspector-luks.sh])
 AC_CONFIG_FILES([installcheck.sh],
                 [chmod +x,-w installcheck.sh])
 AC_CONFIG_FILES([ocaml-dep.sh],
diff --git a/inspector/test-virt-inspector-luks.sh.in b/inspector/test-virt-inspector-luks.sh
similarity index 94%
rename from inspector/test-virt-inspector-luks.sh.in
rename to inspector/test-virt-inspector-luks.sh
index 2d713f16b..9cb062ec4 100755
--- a/inspector/test-virt-inspector-luks.sh.in
+++ b/inspector/test-virt-inspector-luks.sh
@@ -35,7 +35,7 @@ if [ -s "$f" ]; then
     echo FEDORA |
     $VG virt-inspector --keys-from-stdin --format=raw -a "$f" > "actual-$b.xml"
     # Check the generated output validate the schema.
-    @XMLLINT@ --noout --relaxng "$srcdir/virt-inspector.rng" "actual-$b.xml"
+    $XMLLINT --noout --relaxng "$srcdir/virt-inspector.rng" "actual-$b.xml"
     # This 'diff' command will fail (because of -e option) if there
     # are any differences.
     diff -ur $diff_ignore "expected-$b.xml" "actual-$b.xml"
diff --git a/inspector/test-virt-inspector.sh.in b/inspector/test-virt-inspector.sh
similarity index 95%
rename from inspector/test-virt-inspector.sh.in
rename to inspector/test-virt-inspector.sh
index 191f6fbc0..139e68e42 100755
--- a/inspector/test-virt-inspector.sh.in
+++ b/inspector/test-virt-inspector.sh
@@ -31,7 +31,7 @@ for f in ../test-data/phony-guests/{debian,fedora,ubuntu,archlinux,coreos,window
         b=$(basename "$f" .xml)
 	$VG virt-inspector --format=raw -a "$f" > "actual-$b.xml"
         # Check the generated output validate the schema.
-        @XMLLINT@ --noout --relaxng "$srcdir/virt-inspector.rng" "actual-$b.xml"
+        $XMLLINT --noout --relaxng "$srcdir/virt-inspector.rng" "actual-$b.xml"
         # This 'diff' command will fail (because of -e option) if there
         # are any differences.
         diff -ur $diff_ignore "expected-$b.xml" "actual-$b.xml"
diff --git a/inspector/test-xmllint.sh.in b/inspector/test-xmllint.sh
similarity index 93%
rename from inspector/test-xmllint.sh.in
rename to inspector/test-xmllint.sh
index 24ca515bb..0de37f860 100755
--- a/inspector/test-xmllint.sh.in
+++ b/inspector/test-xmllint.sh
@@ -22,5 +22,5 @@ $TEST_FUNCTIONS
 skip_if_skipped
 
 for f in $srcdir/example-*.xml; do
-    @XMLLINT@ --noout --relaxng $srcdir/virt-inspector.rng $f
+    $XMLLINT --noout --relaxng $srcdir/virt-inspector.rng $f
 done
-- 
2.23.0




More information about the Libguestfs mailing list