runtest.sh revision 113451
1#!/bin/sh
2# $FreeBSD: head/sbin/fdisk/runtest.sh 113451 2003-04-13 21:34:16Z phk $
3
4set -e
5MD=`mdconfig -a -t malloc -s 4m -x 63 -y 16`
6if [ ! -c /dev/${MD} ] ; then
7	echo "MD device $MD did not materialize" 1>&2
8	exit 2
9fi
10trap "mdconfig -d -u ${MD}" EXIT INT TERM
11
12# Create an empty bootcode file to isolate our checksum from any changes
13# which might happen to the boot code file.
14dd if=/dev/zero of=tmp count=1 > /dev/null 2>&1
15./fdisk -b tmp -I $MD > /dev/null 2>&1
16rm tmp
17
18c=`dd if=/dev/${MD} count=1 2>/dev/null | md5`
19if [ $c != 509b44919d3921502bd31237c4bb1f75 ] ; then
20	echo "FAILED: fdisk -I gives bad checksum" 1>&2
21	exit 1
22fi
23echo "PASSED: fdisk -I"
24exit 0
25