summaryrefslogtreecommitdiffstats
path: root/sbin/bsdlabel/runtest.sh
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-06-02 14:19:31 +0000
committerphk <phk@FreeBSD.org>2003-06-02 14:19:31 +0000
commit2550ebdaa67be2186e18324278575cf49f6e9804 (patch)
treec494b05b4cc9ff4939fa1b0f118344319158b9ed /sbin/bsdlabel/runtest.sh
parent683fd8c50f782e19bea959c39a5e91aea0cc8fd3 (diff)
downloadFreeBSD-src-2550ebdaa67be2186e18324278575cf49f6e9804.zip
FreeBSD-src-2550ebdaa67be2186e18324278575cf49f6e9804.tar.gz
Fix sectorsize != 512 on i386 and pc98. Add test cases for same.
Diffstat (limited to 'sbin/bsdlabel/runtest.sh')
-rw-r--r--sbin/bsdlabel/runtest.sh35
1 files changed, 20 insertions, 15 deletions
diff --git a/sbin/bsdlabel/runtest.sh b/sbin/bsdlabel/runtest.sh
index e7f3e96..eb43b90 100644
--- a/sbin/bsdlabel/runtest.sh
+++ b/sbin/bsdlabel/runtest.sh
@@ -3,15 +3,18 @@
TMP=/tmp/$$.
set -e
-for ARCH in i386 alpha pc98
+for TEST in "i386 512" "i386 4096" "alpha 512" "pc98 512" "pc98 4096"
do
- echo "ARCH $ARCH"
- MD=`mdconfig -a -t malloc -s 2m`
+ set $TEST
+ ARCH=$1
+ SEC=$2
+ echo "ARCH $ARCH SEC $SEC"
+ MD=`mdconfig -a -t malloc -s 2m -S $SEC`
trap "exec 7</dev/null; rm -f ${TMP}* ; mdconfig -d -u ${MD}" EXIT INT TERM
./bsdlabel -m ${ARCH} -r -w $MD auto
- dd if=/dev/$MD of=${TMP}i0 count=16 > /dev/null 2>&1
+ dd if=/dev/$MD of=${TMP}i0 count=1 bs=8k > /dev/null 2>&1
if [ "$ARCH" = "alpha" ] ; then
dd if=${TMP}i0 of=${TMP}b0 iseek=1 count=15 > /dev/null 2>&1
else
@@ -24,6 +27,7 @@ do
p
s/c:/a:/
s/4096/1024/
+ s/512/64/
}
' ${TMP}l0 > ${TMP}l1
@@ -45,30 +49,31 @@ do
exit 2
fi
- dd if=/dev/$MD of=${TMP}i1 count=16 > /dev/null 2>&1
+ dd if=/dev/$MD of=${TMP}i1 count=1 bs=8k > /dev/null 2>&1
sed '
/ c:/{
p
s/c:/a:/
s/4096/2048/
+ s/512/256/
}
' ${TMP}l0 > ${TMP}l2
./bsdlabel -m ${ARCH} -R $MD ${TMP}l2
- dd if=/dev/$MD of=${TMP}i2 count=16 > /dev/null 2>&1
+ dd if=/dev/$MD of=${TMP}i2 count=1 bs=8k > /dev/null 2>&1
exec 7< /dev/${MD}a
for t in a c
do
- if dd if=${TMP}i2 of=/dev/${MD}$t 2>/dev/null ; then
+ if dd if=${TMP}i2 of=/dev/${MD}$t bs=8k 2>/dev/null ; then
echo "PASS: Could rewrite same label to ...$t while ...a open" 1>&2
else
echo "FAIL: Could not rewrite same label to ...$t while ...a open" 1>&2
exit 2
fi
- if dd if=${TMP}i1 of=/dev/${MD}$t 2>/dev/null ; then
+ if dd if=${TMP}i1 of=/dev/${MD}$t bs=8k 2>/dev/null ; then
echo "FAIL: Could label with smaller ...a to ...$t while ...a open" 1>&2
exit 2
else
@@ -85,42 +90,42 @@ do
exec 7< /dev/null
- if dd if=${TMP}i0 of=/dev/${MD}c 2>/dev/null ; then
+ if dd if=${TMP}i0 of=/dev/${MD}c bs=8k 2>/dev/null ; then
echo "PASS: Could write missing ...a label to ...c" 1>&2
else
echo "FAIL: Could not write missing ...a label to ...c" 1>&2
exit 2
fi
- if dd if=${TMP}i2 of=/dev/${MD}c 2>/dev/null ; then
+ if dd if=${TMP}i2 of=/dev/${MD}c bs=8k 2>/dev/null ; then
echo "PASS: Could write large ...a label to ...c" 1>&2
else
echo "FAIL: Could not write large ...a label to ...c" 1>&2
exit 2
fi
- if dd if=${TMP}i1 of=/dev/${MD}c 2>/dev/null ; then
+ if dd if=${TMP}i1 of=/dev/${MD}c bs=8k 2>/dev/null ; then
echo "PASS: Could write small ...a label to ...c" 1>&2
else
echo "FAIL: Could not write small ...a label to ...c" 1>&2
exit 2
fi
- if dd if=${TMP}i2 of=/dev/${MD}a 2>/dev/null ; then
+ if dd if=${TMP}i2 of=/dev/${MD}a bs=8k 2>/dev/null ; then
echo "PASS: Could increase size of ...a by writing to ...a" 1>&2
else
echo "FAIL: Could not increase size of ...a by writing to ...a" 1>&2
exit 2
fi
- if dd if=${TMP}i1 of=/dev/${MD}a 2>/dev/null ; then
+ if dd if=${TMP}i1 of=/dev/${MD}a bs=8k 2>/dev/null ; then
echo "FAIL: Could decrease size of ...a by writing to ...a" 1>&2
exit 2
else
echo "PASS: Could not decrease size of ...a by writing to ...a" 1>&2
fi
- if dd if=${TMP}i0 of=/dev/${MD}a 2>/dev/null ; then
+ if dd if=${TMP}i0 of=/dev/${MD}a bs=8k 2>/dev/null ; then
echo "FAIL: Could delete ...a by writing to ...a" 1>&2
exit 2
else
@@ -153,7 +158,7 @@ do
fi
exec 7> /dev/null
- if dd if=${TMP}i0 of=/dev/${MD}c 2>/dev/null ; then
+ if dd if=${TMP}i0 of=/dev/${MD}c bs=8k 2>/dev/null ; then
echo "PASS: Could delete ...a by writing to ...c" 1>&2
else
echo "FAIL: Could not delete ...a by writing to ...c" 1>&2
OpenPOWER on IntegriCloud