[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 5/8] tests: Make setup errors in grub-fs-tester hard errors
From: |
Glenn Washburn |
Subject: |
[PATCH v2 5/8] tests: Make setup errors in grub-fs-tester hard errors |
Date: |
Wed, 25 Aug 2021 02:03:59 -0500 |
When a test program fails because it failed to setup the test properly, this
does not indicate a failure in what is attempting to be tested because the
test is never run. So exit with a hard error exit status to note this
difference. This will allow easier detection of tests that are not actually
being run and those that are really failing.
Signed-off-by: Glenn Washburn <development@efficientek.com>
---
tests/util/grub-fs-tester.in | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/tests/util/grub-fs-tester.in b/tests/util/grub-fs-tester.in
index 4213b7bfc..eacb1e0a7 100644
--- a/tests/util/grub-fs-tester.in
+++ b/tests/util/grub-fs-tester.in
@@ -6,7 +6,8 @@ fs="$1"
GRUBFSTEST="@builddir@/grub-fstest"
-tempdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` || exit 1
+tempdir=`mktemp -d "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"` ||
+{ echo "Failed to make temporary directory"; exit 99; }
# This wrapper is to ease insertion of valgrind or time statistics
run_it () {
@@ -273,7 +274,7 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE"
1); do
done
if test "$CFILESRC" = "" ; then
echo "Couldn't find compressible file" >&2
- exit 1
+ exit 99
fi
case x"$fs" in
# FS LIMITATION: 8.3 names
@@ -616,7 +617,7 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE"
1); do
mkdir -p "$MNTPOINTRO"
for i in $(range 0 $((NDEVICES-1)) 1); do
dd if=/dev/zero of="$FSIMAGEP${i}.img" count=1 bs=1
seek=$((DISKSIZE-1)) &> /dev/null
- LODEVICE=$(losetup --find --show "$FSIMAGEP${i}.img")
+ LODEVICE=$(losetup --find --show "$FSIMAGEP${i}.img")
|| exit 99
LODEVICES="$LODEVICES $LODEVICE"
if test "$i" = 0; then
MOUNTDEVICE="$LODEVICE"
@@ -820,7 +821,7 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE"
1); do
"mkfs.xfs" -m crc=1 -b size=$BLKSIZE -s size=$SECSIZE -L
"$FSLABEL" -q "${MOUNTDEVICE}" ;;
*)
echo "Add appropriate mkfs command here"
- exit 1
+ exit 99
;;
esac
BASEFILE="1.img"
@@ -926,7 +927,7 @@ for LOGSECSIZE in $(range "$MINLOGSECSIZE" "$MAXLOGSECSIZE"
1); do
for i in $(range 0 $((NDEVICES-1)) 1); do
rm "$FSIMAGEP${i}.img"
done
- exit 1;
+ exit 99;
fi
;;
esac
--
2.27.0
- Re: [PATCH v2 1/8] tests: Make sure LANG is set properly for iso9660_test, (continued)
- Re: [PATCH v2 1/8] tests: Make sure LANG is set properly for iso9660_test, Thomas Schmitt, 2021/08/26
- Re: [PATCH v2 1/8] tests: Make sure LANG is set properly for iso9660_test, Glenn Washburn, 2021/08/26
- Re: [PATCH v2 1/8] tests: Make sure LANG is set properly for iso9660_test, Thomas Schmitt, 2021/08/26
- Re: [PATCH v2 1/8] tests: Make sure LANG is set properly for iso9660_test, Glenn Washburn, 2021/08/26
- Re: [PATCH v2 1/8] tests: Make sure LANG is set properly for iso9660_test, Thomas Schmitt, 2021/08/27
- Re: [PATCH v2 1/8] tests: Make sure LANG is set properly for iso9660_test, Glenn Washburn, 2021/08/27
- Re: [PATCH v2 1/8] tests: Make sure LANG is set properly for iso9660_test, Thomas Schmitt, 2021/08/27
[PATCH v2 4/8] tests: Fail immediately when grub-shell fails and do not occlude the error code, Glenn Washburn, 2021/08/25
[PATCH v2 8/8] tests: Use @BUILD_SHEBANG@ autoconf var instead of literal shell, Glenn Washburn, 2021/08/25
[PATCH v2 3/8] tests: When checking squashfs fstime, use superblock last modified time, Glenn Washburn, 2021/08/25
[PATCH v2 5/8] tests: Make setup errors in grub-fs-tester hard errors,
Glenn Washburn <=
[PATCH v2 6/8] tests: A failure of mktemp should cause the test script to exit with code 99, Glenn Washburn, 2021/08/25
[PATCH v2 7/8] tests: Exit with skipped exit code when test not performed, Glenn Washburn, 2021/08/25