[Libguestfs] [PATCH 1/2] tests: fix rhbz1044014 to use proper paths

Nikolay Shirokovskiy nikolay.shirokovskiy at openvz.org
Fri Apr 8 12:24:50 UTC 2022


Test fails as it cannot find .in file. Turns out $srcdir=. (which is ./tests) and
and not ./tests/regressions as supposed in script. Same apply to
$abs_srcdir.

Also put .out file in ./tests/regressions too.

Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy at openvz.org>
---
 tests/regressions/rhbz1044014.sh | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/tests/regressions/rhbz1044014.sh b/tests/regressions/rhbz1044014.sh
index f010f2ee2..9cdcc2be1 100755
--- a/tests/regressions/rhbz1044014.sh
+++ b/tests/regressions/rhbz1044014.sh
@@ -27,36 +27,37 @@ skip_unless_backend libvirt
 skip_unless_libvirt_minimum_version 1 2 1
 
 # Set the backend to the test driver.
-export LIBGUESTFS_BACKEND="libvirt:test://$abs_srcdir/rhbz1044014.xml"
+export LIBGUESTFS_BACKEND="libvirt:test://$abs_srcdir/regressions/rhbz1044014.xml"
 
-rm -f rhbz1044014.out
+dir=$srcdir/regressions
+rm -f $dir/rhbz1044014.out
 
-guestfish -- -run < $srcdir/rhbz1044014.in > rhbz1044014.out 2>&1 || {
+guestfish -- -run < $dir/rhbz1044014.in > $dir/rhbz1044014.out 2>&1 || {
     r=$?
     if [ $r -ne 0 ]; then
-        cat rhbz1044014.out
+        cat $dir/rhbz1044014.out
         exit $r
     fi
 }
 
 # We are expecting this message to be printed (see commit which fixed
 # RHBZ#1044014).
-grep "libvirt needs authentication to connect to libvirt URI" rhbz1044014.out || {
+grep "libvirt needs authentication to connect to libvirt URI" $dir/rhbz1044014.out || {
     echo "$0: expecting to see message from commit which fixed RHBZ#1044014"
     echo
     echo "actual output was:"
     echo
-    cat rhbz1044014.out
+    cat $dir/rhbz1044014.out
     exit 1
 }
 
 # This is the error we are expecting to see.  If we see it then it
 # indicates that authentication was successful.
-grep "error: libvirt hypervisor doesn’t support qemu or KVM" rhbz1044014.out || {
+grep "error: libvirt hypervisor doesn’t support qemu or KVM" $dir/rhbz1044014.out || {
     echo "$0: unexpected output:"
     echo
-    cat rhbz1044014.out
+    cat $dir/rhbz1044014.out
     exit 1
 }
 
-rm rhbz1044014.out
+rm $dir/rhbz1044014.out
-- 
2.35.1



More information about the Libguestfs mailing list