6 for TEST in "i386 512" "i386 4096" "alpha 512"
11 echo "ARCH $ARCH SEC $SEC"
12 MD=`mdconfig -a -t malloc -s 2m -S $SEC`
13 trap "exec 7</dev/null; rm -f ${TMP}* ; mdconfig -d -u ${MD}" EXIT INT TERM
15 ./bsdlabel -m ${ARCH} -r -w $MD auto
17 dd if=/dev/$MD of=${TMP}i0 count=1 bs=8k > /dev/null 2>&1
18 if [ "$ARCH" = "alpha" ] ; then
19 dd if=${TMP}i0 of=${TMP}b0 iseek=1 count=15 > /dev/null 2>&1
23 ./bsdlabel -m ${ARCH} $MD > ${TMP}l0
34 ./bsdlabel -m ${ARCH} -R $MD ${TMP}l1
35 if [ -c /dev/${MD}a ] ; then
36 echo "PASS: Created a: partition" 1>&2
38 echo "FAIL: Did not create a: partition" 1>&2
42 # Spoil and rediscover
45 if [ -c /dev/${MD}a ] ; then
46 echo "PASS: Recreated a: partition after spoilage" 1>&2
48 echo "FAIL: Did not recreate a: partition after spoilage" 1>&2
52 dd if=/dev/$MD of=${TMP}i1 count=1 bs=8k > /dev/null 2>&1
62 ./bsdlabel -m ${ARCH} -R $MD ${TMP}l2
63 dd if=/dev/$MD of=${TMP}i2 count=1 bs=8k > /dev/null 2>&1
69 if dd if=${TMP}i2 of=/dev/${MD}$t bs=8k 2>/dev/null ; then
70 echo "PASS: Could rewrite same label to ...$t while ...a open" 1>&2
72 echo "FAIL: Could not rewrite same label to ...$t while ...a open" 1>&2
76 if dd if=${TMP}i1 of=/dev/${MD}$t bs=8k 2>/dev/null ; then
77 echo "FAIL: Could label with smaller ...a to ...$t while ...a open" 1>&2
80 echo "PASS: Could not label with smaller ...a to ...$t while ...a open" 1>&2
83 if dd if=${TMP}i0 of=/dev/${MD}$t 2>/dev/null ; then
84 echo "FAIL: Could write label missing ...a to ...$t while ...a open" 1>&2
87 echo "PASS: Could not write label missing ...a to ...$t while ...a open" 1>&2
93 if dd if=${TMP}i0 of=/dev/${MD}c bs=8k 2>/dev/null ; then
94 echo "PASS: Could write missing ...a label to ...c" 1>&2
96 echo "FAIL: Could not write missing ...a label to ...c" 1>&2
100 if dd if=${TMP}i2 of=/dev/${MD}c bs=8k 2>/dev/null ; then
101 echo "PASS: Could write large ...a label to ...c" 1>&2
103 echo "FAIL: Could not write large ...a label to ...c" 1>&2
107 if dd if=${TMP}i1 of=/dev/${MD}c bs=8k 2>/dev/null ; then
108 echo "PASS: Could write small ...a label to ...c" 1>&2
110 echo "FAIL: Could not write small ...a label to ...c" 1>&2
114 if dd if=${TMP}i2 of=/dev/${MD}a bs=8k 2>/dev/null ; then
115 echo "PASS: Could increase size of ...a by writing to ...a" 1>&2
117 echo "FAIL: Could not increase size of ...a by writing to ...a" 1>&2
121 if dd if=${TMP}i1 of=/dev/${MD}a bs=8k 2>/dev/null ; then
122 echo "FAIL: Could decrease size of ...a by writing to ...a" 1>&2
125 echo "PASS: Could not decrease size of ...a by writing to ...a" 1>&2
128 if dd if=${TMP}i0 of=/dev/${MD}a bs=8k 2>/dev/null ; then
129 echo "FAIL: Could delete ...a by writing to ...a" 1>&2
132 echo "PASS: Could not delete ...a by writing to ...a" 1>&2
135 if ./bsdlabel -m ${ARCH} -B -b ${TMP}b0 ${MD} ; then
136 if [ ! -c /dev/${MD}a ] ; then
137 echo "FAILED: Writing bootcode killed ...a" 1>&2
140 echo "PASS: Could write bootcode while closed" 1>&2
143 echo "FAILED: Could not write bootcode while closed" 1>&2
148 if ./bsdlabel -m ${ARCH} -B -b ${TMP}b0 ${MD} ; then
149 if [ ! -c /dev/${MD}a ] ; then
150 echo "FAILED: Writing bootcode killed ...a" 1>&2
153 echo "PASS: Could write bootcode while open" 1>&2
156 echo "FAILED: Could not write bootcode while open" 1>&2
161 if dd if=${TMP}i0 of=/dev/${MD}c bs=8k 2>/dev/null ; then
162 echo "PASS: Could delete ...a by writing to ...c" 1>&2
164 echo "FAIL: Could not delete ...a by writing to ...c" 1>&2
168 # XXX: need to add a 'b' partition and check for overlaps.
174 trap "" EXIT INT TERM