tests: A failure of mktemp should cause the test script to exit with code 99

A test exiting with code 99 means that there was an error in the test itself
and not a failure in the thing being tested (also known as a hard error).

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Glenn Washburn authored and Daniel Kiper committed 2021-10-14 15:00:06 +02:00
1 parent 579575be38
commit bcb15e011a
11 files changed
+21 -21

No files matched your search

+3 -3
View File
@@ -2,7 +2,7 @@
set -e
# create a randome file
file="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
file="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 99
cat >$file <<EOF
hello world!
EOF
@@ -16,12 +16,12 @@ else
fi
outfile1="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
outfile1="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 99
@builddir@/grub-shell --files=/boot/grub/file=$file >$outfile1 <<EOF
sha512sum $grub_file
EOF
outfile2="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 1
outfile2="`mktemp "${TMPDIR:-/tmp}/tmp.XXXXXXXXXX"`" || exit 99
sha512sum $file >$outfile2
SHA1=`cat $outfile1 | tr -d '\n' | cut -f1 -d\ `