tests: fix rhbz1044014 to use proper paths

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@openvz.org>
This commit is contained in:
Nikolay Shirokovskiy
2022-04-08 15:24:50 +03:00
committed by Richard W.M. Jones
parent 3115726aca
commit 5552ef1c46

View File

@@ -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 doesnt support qemu or KVM" rhbz1044014.out || {
grep "error: libvirt hypervisor doesnt 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