diff options
author | phk <phk@FreeBSD.org> | 2003-04-13 21:57:08 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2003-04-13 21:57:08 +0000 |
commit | a9021891fc546a05ccda5639e9b06c6e1cfece8b (patch) | |
tree | 23dda90ce85edcbe387caf06bed9c8001194eea2 /sbin/fdisk/runtest.sh | |
parent | 08ad0d0b12b05574b3ca8dc82085cf761ced1cb6 (diff) | |
download | FreeBSD-src-a9021891fc546a05ccda5639e9b06c6e1cfece8b.zip FreeBSD-src-a9021891fc546a05ccda5639e9b06c6e1cfece8b.tar.gz |
Use symbolic constants from <sys/diskmbr.h> instead of local constants.
Always set the magic sequence when we write, rather than trusting the
previously read boot code to do so.
Use explicit encoding/decoding of little endian disk image.
Remove a comment which was OBE.
Change the test vector for "fdisk -I" to reflect that there is a magic
sequence in the result now.
Add test case for "fdisk" which reads the image back.
At least for the two test-cases this program now gives the same result
on sparc64 as on i386. The lack of an installed /boot/mbr on sparc64
raises an (un)interesting question.
Diffstat (limited to 'sbin/fdisk/runtest.sh')
-rw-r--r-- | sbin/fdisk/runtest.sh | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/sbin/fdisk/runtest.sh b/sbin/fdisk/runtest.sh index 24ab20b..f25f427 100644 --- a/sbin/fdisk/runtest.sh +++ b/sbin/fdisk/runtest.sh @@ -16,9 +16,15 @@ dd if=/dev/zero of=tmp count=1 > /dev/null 2>&1 rm tmp c=`dd if=/dev/${MD} count=1 2>/dev/null | md5` -if [ $c != 509b44919d3921502bd31237c4bb1f75 ] ; then - echo "FAILED: fdisk -I gives bad checksum" 1>&2 +if [ $c != ea4277fcccb6a927a1a497a6b15bfb8c ] ; then + echo "FAILED: 'fdisk -I' gives bad checksum ($c)" 1>&2 exit 1 fi echo "PASSED: fdisk -I" +c=`./fdisk $MD | md5` +if [ $c != 4b126d7ac4c6b2af7ef27ede8ef102ec ] ; then + echo "FAILED: 'fdisk' gives bad checksum ($c)" 1>&2 + exit 1 +fi +echo "PASSED: fdisk" exit 0 |