tests: Add pathological iso9660 filesystem tests
PATCH 1/1 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.
--- tests/iso9660_ce_loop.iso.gz | Bin 0 -> 897 bytes tests/iso9660_ce_loop2.iso.gz | Bin 0 -> 904 bytes tests/iso9660_test.in | 11 ++++++++++- 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/iso9660_ce_loop.iso.gz create mode 100644 tests/iso9660_ce_loop2.iso.gz
tests/iso9660_ce_loop.iso.gz new file binary +0 -0
tests/iso9660_ce_loop2.iso.gz new file binary +0 -0
tests/iso9660_test.in +10 -1
@@ -12,4 +12,13 @@ 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 +"@builddir@/grub-fs-tester" rockridge_joliet_1999 + +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" + output=$(LC_ALL=C timeout -s KILL "60" \ + "@builddir@/grub-fstest" "${tempdir}/${fs}.iso" ls / ) + test "$?" -eq 0 -a -z "$output" +done
Signature · 1 line
2.34.1
Hi,
Quoted 13 lines · Glenn Washburn
tests/iso9660_test.in +4
-1@@ -12,4 +12,13 @@ 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 +"@builddir@/grub-fs-tester" rockridge_joliet_1999 + +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"` ||
tests/iso9660_test.in fi · line 24
Quoted 6 lines
tests/iso9660_test.in +6
-0+ { echo "Failed to make temporary directory"; exit 99; } + gunzip <"$srcdir"/tests/${fs}.iso.gz >"${tempdir}/${fs}.iso" + output=$(LC_ALL=C timeout -s KILL "60" \ + "@builddir@/grub-fstest" "${tempdir}/${fs}.iso" ls / ) + test "$?" -eq 0 -a -z "$output" +done
Shouldn't the decompressed files and the temporary directory be removed afterwards ?
Have a nice day :)
Thomas
Quoted 17 lines · On Sun, 05 Feb 2023 09:24:21 +0100 "Thomas Schmitt" <[email protected]> wrote:
Hi,
Quoted 14 lines · Glenn Washburn
tests/iso9660_test.in +4
-1@@ -12,4 +12,13 @@ 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 +"@builddir@/grub-fs-tester" rockridge_joliet_1999 + +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; }
Quoted 8 lines
tests/iso9660_test.in fi · line 24
Quoted 5 lines
tests/iso9660_test.in +5
-0+ gunzip <"$srcdir"/tests/${fs}.iso.gz >"${tempdir}/${fs}.iso" + output=$(LC_ALL=C timeout -s KILL "60" \ + "@builddir@/grub-fstest" "${tempdir}/${fs}.iso" ls / ) + test "$?" -eq 0 -a -z "$output" +doneShouldn't the decompressed files and the temporary directory be removed afterwards ?
Yes, good catch. I'll update.
Glenn