[Libguestfs] [PATCH 3/4] p2v: fix tests with srcdir!=builddir

Pino Toscano ptoscano at redhat.com
Mon Jul 8 17:01:46 UTC 2019


Point to files in the source directory using the right variables, so
they are found also when the build directory is different than the
source directory.
---
 p2v/test-virt-p2v-docs.sh   | 2 +-
 p2v/test-virt-p2v-nbdkit.sh | 4 ++--
 p2v/test-virt-p2v.sh        | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/p2v/test-virt-p2v-docs.sh b/p2v/test-virt-p2v-docs.sh
index 5ef3c7f4e..d4942de4e 100755
--- a/p2v/test-virt-p2v-docs.sh
+++ b/p2v/test-virt-p2v-docs.sh
@@ -21,4 +21,4 @@ set -e
 $TEST_FUNCTIONS
 skip_if_skipped
 
-$top_srcdir/podcheck.pl virt-p2v.pod virt-p2v
+$top_srcdir/podcheck.pl $srcdir/virt-p2v.pod virt-p2v
diff --git a/p2v/test-virt-p2v-nbdkit.sh b/p2v/test-virt-p2v-nbdkit.sh
index 5c635bb03..cf7a416bc 100755
--- a/p2v/test-virt-p2v-nbdkit.sh
+++ b/p2v/test-virt-p2v-nbdkit.sh
@@ -37,8 +37,8 @@ mkdir $d
 # We don't want the program under test to run real 'ssh' or 'scp'.
 # They won't work.  Therefore create dummy 'ssh' and 'scp' binaries.
 pushd $d
-ln -sf ../test-virt-p2v-ssh.sh ssh
-ln -sf ../test-virt-p2v-scp.sh scp
+ln -sf "$abs_srcdir/test-virt-p2v-ssh.sh" ssh
+ln -sf "$abs_srcdir/test-virt-p2v-scp.sh" scp
 popd
 export PATH=$d:$PATH
 
diff --git a/p2v/test-virt-p2v.sh b/p2v/test-virt-p2v.sh
index 121bf12eb..a6b07274e 100755
--- a/p2v/test-virt-p2v.sh
+++ b/p2v/test-virt-p2v.sh
@@ -36,8 +36,8 @@ mkdir $d
 # We don't want the program under test to run real 'ssh' or 'scp'.
 # They won't work.  Therefore create dummy 'ssh' and 'scp' binaries.
 pushd $d
-ln -sf ../test-virt-p2v-ssh.sh ssh
-ln -sf ../test-virt-p2v-scp.sh scp
+ln -sf "$abs_srcdir/test-virt-p2v-ssh.sh" ssh
+ln -sf "$abs_srcdir/test-virt-p2v-scp.sh" scp
 popd
 export PATH=$d:$PATH
 
-- 
2.21.0




More information about the Libguestfs mailing list