summaryrefslogtreecommitdiff
path: root/tests/dev
diff options
context:
space:
mode:
authormartin <martin@NetBSD.org>2017-03-15 10:53:15 +0000
committermartin <martin@NetBSD.org>2017-03-15 10:53:15 +0000
commitfb34a96f71ec5cda2b6f8073227bcd1d3dcfe79f (patch)
treeee4a59e7ec8e2f3d7c6527b181a61ec599c5f668 /tests/dev
parente8fa4b9d0512b316b7e604085d6e1f4839bb5960 (diff)
Do not assume an all-zeroes disk label will read back as a disk with
an 'a' partition covering the whole disk, instead use the raw partition. Also skip this test if the fss device is not available. With lots of help from pgoyette.
Diffstat (limited to 'tests/dev')
-rwxr-xr-xtests/dev/fss/t_fss.sh28
1 files changed, 15 insertions, 13 deletions
diff --git a/tests/dev/fss/t_fss.sh b/tests/dev/fss/t_fss.sh
index cb3341fbb6a..aace7626cef 100755
--- a/tests/dev/fss/t_fss.sh
+++ b/tests/dev/fss/t_fss.sh
@@ -1,4 +1,4 @@
-# $NetBSD: t_fss.sh,v 1.2 2016/07/29 20:27:37 pgoyette Exp $
+# $NetBSD: t_fss.sh,v 1.3 2017/03/15 10:53:15 martin Exp $
#
# Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
# All rights reserved.
@@ -28,12 +28,20 @@
# Verify basic operation of fss(4) file system snapshot device
#
+vnddev=vnd0
+rawpart=$( sysctl -n kern.rawpartition | tr '01234' 'abcde' )
+vnd=/dev/${vnddev}${rawpart}
+
orig_data="Original data"
repl_data="Replacement data"
atf_test_case basic cleanup
basic_body() {
+# verify fss is available (or loadable as a module)
+
+ fssconfig -l /dev/fss0 > /dev/null || atf_skip "FSS not available"
+
# create of mount-points for the file system and snapshot
mkdir ./m1
@@ -43,9 +51,9 @@ basic_body() {
# and mount it
dd if=/dev/zero of=./image bs=32k count=64
- vndconfig -c vnd0 ./image
- newfs /dev/vnd0a
- mount /dev/vnd0a ./m1
+ vndconfig -c ${vnddev} ./image
+ newfs -I ${vnd}
+ mount ${vnd} ./m1
echo "${orig_data}" > ./m1/text
@@ -62,20 +70,14 @@ basic_body() {
read test_data < ./m2/text
atf_check_equal "${orig_data}" "${test_data}"
-
-# Unmount our temporary stuff
-
- umount /dev/fss0 || true
- fssconfig -u fss0 || true
- umount /dev/vnd0a || true
- vndconfig -u vnd0 || true
}
basic_cleanup() {
- umount /dev/vnd0a || true
+# Unmount our temporary stuff
+ umount ${vnd} || true
fssconfig -u fss0 || true
umount /dev/fss0 || true
- vndconfig -u vnd0 || true
+ vndconfig -u ${vnddev} || true
}
atf_init_test_cases()