File: iso9660_test.in

package info (click to toggle)
grub2 2.14-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 81,540 kB
  • sloc: ansic: 550,889; asm: 68,074; sh: 9,818; cpp: 2,095; makefile: 1,916; python: 1,546; sed: 450; lex: 393; yacc: 268; awk: 85; lisp: 54; perl: 31
file content (53 lines) | stat: -rw-r--r-- 1,711 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!@BUILD_SHEBANG@

set -ex

if ! which xorriso >/dev/null 2>&1; then
   echo "xorriso not installed; cannot test iso9660."
   exit 99
fi

"@builddir@/grub-fs-tester" joliet
"@builddir@/grub-fs-tester" rockridge
"@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

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"

echo "Testing for proper handling of early CE ... "
fs=iso9660_early_ce
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
ret=0
output=$(LC_ALL=C timeout -s KILL "60" \
  "@builddir@/grub-fstest" "${tempdir}/${fs}.iso" ls / ) || ret=$?
rm -rf "$tempdir"
if [ "${ret:-0}" -ne 0 ]; then
  echo "... grub-fstest returns $ret"
  echo "FAIL ($fs)"
  exit 1
fi
# Before comparing: remove trailing blank added by grub-fstest
output=$(echo -n $output)
if [ x"$output" != x"RockRidgeName:x" ]; then
  echo "... found: '$output' , expected: 'RockRidgeName:x'"
  echo "FAIL ($fs)"
  exit 1
fi
echo "PASS"