From: Glenn Washburn Date: Thu, 16 Feb 2023 07:04:37 +0000 (-0600) Subject: tests: Add pathological iso9660 filesystem tests X-Git-Tag: grub-2.12-rc1~131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ddd8e8ad4392f395117f657a317ff091cf59839;p=thirdparty%2Fgrub.git tests: Add pathological iso9660 filesystem tests These are not added to grub-fs-tester because they are not generated and none of the filesystem tests are run on these ISOs. The test is to run the command "ls /" on the ISO, and a failure is determined if the command times out, has non-zero return value or has any output. Signed-off-by: Glenn Washburn Tested-by: Thomas Schmitt Reviewed-by: Daniel Kiper --- diff --git a/tests/iso9660_ce_loop.iso.gz b/tests/iso9660_ce_loop.iso.gz new file mode 100644 index 000000000..9c53c569b Binary files /dev/null and b/tests/iso9660_ce_loop.iso.gz differ diff --git a/tests/iso9660_ce_loop2.iso.gz b/tests/iso9660_ce_loop2.iso.gz new file mode 100644 index 000000000..f59e67647 Binary files /dev/null and b/tests/iso9660_ce_loop2.iso.gz differ diff --git a/tests/iso9660_test.in b/tests/iso9660_test.in index ed0a5bf8d..44bc08c6d 100644 --- a/tests/iso9660_test.in +++ b/tests/iso9660_test.in @@ -12,4 +12,19 @@ fi "@builddir@/grub-fs-tester" rockridge_joliet "@builddir@/grub-fs-tester" joliet_1999 "@builddir@/grub-fs-tester" rockridge_1999 -"@builddir@/grub-fs-tester" rockridge_joliet_1999 \ No newline at end of file +"@builddir@/grub-fs-tester" rockridge_joliet_1999 + +echo "Testing for proper recognition of CE loops ... " +for fs in iso9660_ce_loop iso9660_ce_loop2; do + tempdir=`mktemp -d "${TMPDIR:-/tmp}/${0##*/}.$(date '+%Y%m%d%H%M%S%N').${fs}.XXX"` || + { echo "Failed to make temporary directory"; exit 99; } + gunzip <"$srcdir"/tests/${fs}.iso.gz >"${tempdir}/${fs}.iso" || exit 99 + output=$(LC_ALL=C timeout -s KILL "60" \ + "@builddir@/grub-fstest" "${tempdir}/${fs}.iso" ls / ) || ret=$? + rm -rf "$tempdir" + if [ "${ret:-0}" -ne 0 -o -n "$output" ]; then + echo "FAIL ($fs)" + exit 1 + fi +done +echo "PASS"