Nikolay Shirokovskiy
2022-Apr-08 12:24 UTC
[Libguestfs] [PATCH 0/2] tests: fix a couple of paths to test assets
rhbz1044014 actually fails in my setup which is suprising. Yet the test code seems to have an issue with paths. rhbz1370424 does not fail but have the same issue. I guess the test itself need to be fixed further. Although it can not find the .xml file the test returns success. Also the test does not differentiate between error and guestfish crash as declared in comments. Nikolay Shirokovskiy (2): tests: fix rhbz1044014 to use proper paths tests: fix rhbz1370424 to use proper path tests/regressions/rhbz1044014.sh | 19 ++++++++++--------- tests/regressions/rhbz1370424.sh | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) -- 2.35.1
Nikolay Shirokovskiy
2022-Apr-08 12:24 UTC
[Libguestfs] [PATCH 1/2] 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 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
Nikolay Shirokovskiy
2022-Apr-08 12:24 UTC
[Libguestfs] [PATCH 2/2] tests: fix rhbz1370424 to use proper path
Test fails as it cannot find .xml file. Turns out $pwd=./tests and
and not ./tests/regressions as supposed in script.
Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy at openvz.org>
---
tests/regressions/rhbz1370424.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/regressions/rhbz1370424.sh b/tests/regressions/rhbz1370424.sh
index f12e160ed..fd91bd0d6 100755
--- a/tests/regressions/rhbz1370424.sh
+++ b/tests/regressions/rhbz1370424.sh
@@ -27,7 +27,7 @@ skip_if_skipped
guestfish <<EOF
-add-domain rhbz1370424 \
- libvirturi:test://$(pwd)/rhbz1370424.xml \
+ libvirturi:test://$srcdir/regressions/rhbz1370424.xml \
readonly:true
# The test is just that the above command does not segfault.
# We don't need to do anything else here.
--
2.35.1