summaryrefslogtreecommitdiffstats
path: root/sbin/sunlabel
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-04-23 08:25:44 +0000
committerphk <phk@FreeBSD.org>2003-04-23 08:25:44 +0000
commitf00eb2c09fbd6c0372deb62b97fc0685171e64f9 (patch)
tree3971ab02de1501953eeb73ea920d9723a71101df /sbin/sunlabel
parent47ef37e7e2594b33cff2386732823506b4745261 (diff)
downloadFreeBSD-src-f00eb2c09fbd6c0372deb62b97fc0685171e64f9.zip
FreeBSD-src-f00eb2c09fbd6c0372deb62b97fc0685171e64f9.tar.gz
Add testcases to ensure that overwriting bootcode does not trash label.
Diffstat (limited to 'sbin/sunlabel')
-rw-r--r--sbin/sunlabel/runtest.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/sbin/sunlabel/runtest.sh b/sbin/sunlabel/runtest.sh
index 8bddd67..73833e0 100644
--- a/sbin/sunlabel/runtest.sh
+++ b/sbin/sunlabel/runtest.sh
@@ -119,6 +119,32 @@ else
echo "PASS: Could not delete ...a by writing to ...a" 1>&2
fi
+if ./sunlabel -B -b ${TMP}i0 ${MD} ; then
+ if [ ! -c /dev/${MD}a ] ; then
+ echo "FAILED: Writing bootcode killed ...a" 1>&2
+ exit 2
+ else
+ echo "PASS: Could write bootcode while closed" 1>&2
+ fi
+else
+ echo "FAILED: Could not write bootcode while closed" 1>&2
+ exit 2
+fi
+
+exec 7> /dev/${MD}c
+if ktrace ./sunlabel -B -b ${TMP}i0 ${MD} ; then
+ if [ ! -c /dev/${MD}a ] ; then
+ echo "FAILED: Writing bootcode killed ...a" 1>&2
+ exit 2
+ else
+ echo "PASS: Could write bootcode while open" 1>&2
+ fi
+else
+ echo "FAILED: Could not write bootcode while open" 1>&2
+ exit 2
+fi
+exec 7> /dev/null
+
if dd if=${TMP}i0 of=/dev/${MD}c 2>/dev/null ; then
echo "PASS: Could delete ...a by writing to ...c" 1>&2
else
OpenPOWER on IntegriCloud