iso9660_test.in 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!@BUILD_SHEBANG@
  2. set -e
  3. if ! which xorriso >/dev/null 2>&1; then
  4. echo "xorriso not installed; cannot test iso9660."
  5. exit 99
  6. fi
  7. "@builddir@/grub-fs-tester" joliet
  8. "@builddir@/grub-fs-tester" rockridge
  9. "@builddir@/grub-fs-tester" rockridge_joliet
  10. "@builddir@/grub-fs-tester" joliet_1999
  11. "@builddir@/grub-fs-tester" rockridge_1999
  12. "@builddir@/grub-fs-tester" rockridge_joliet_1999
  13. echo "Testing for proper recognition of CE loops ... "
  14. for fs in iso9660_ce_loop iso9660_ce_loop2; do
  15. tempdir=`mktemp -d "${TMPDIR:-/tmp}/${0##*/}.$(date '+%Y%m%d%H%M%S%N').${fs}.XXX"` ||
  16. { echo "Failed to make temporary directory"; exit 99; }
  17. gunzip <"$srcdir"/tests/${fs}.iso.gz >"${tempdir}/${fs}.iso" || exit 99
  18. output=$(LC_ALL=C timeout -s KILL "60" \
  19. "@builddir@/grub-fstest" "${tempdir}/${fs}.iso" ls / ) || ret=$?
  20. rm -rf "$tempdir"
  21. if [ "${ret:-0}" -ne 0 -o -n "$output" ]; then
  22. echo "FAIL ($fs)"
  23. exit 1
  24. fi
  25. done
  26. echo "PASS"
  27. echo "Testing for proper handling of early CE ... "
  28. fs=iso9660_early_ce
  29. tempdir=`mktemp -d "${TMPDIR:-/tmp}/${0##*/}.$(date '+%Y%m%d%H%M%S%N').${fs}.XXX"` ||
  30. { echo "Failed to make temporary directory"; exit 99; }
  31. gunzip <"$srcdir"/tests/${fs}.iso.gz >"${tempdir}/${fs}.iso" || exit 99
  32. ret=0
  33. output=$(LC_ALL=C timeout -s KILL "60" \
  34. "@builddir@/grub-fstest" "${tempdir}/${fs}.iso" ls / ) || ret=$?
  35. rm -rf "$tempdir"
  36. if [ "${ret:-0}" -ne 0 ]; then
  37. echo "... grub-fstest returns $ret"
  38. echo "FAIL ($fs)"
  39. exit 1
  40. fi
  41. # Before comparing: remove trailing blank added by grub-fstest
  42. output=$(echo -n $output)
  43. if [ x"$output" != x"RockRidgeName:x" ]; then
  44. echo "... found: '$output' , expected: 'RockRidgeName:x'"
  45. echo "FAIL ($fs)"
  46. exit 1
  47. fi
  48. echo "PASS"