Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/fs/tmpfs Do not assume anything about the pseudo-diskl...



details:   https://anonhg.NetBSD.org/src/rev/241343981b9b
branches:  trunk
changeset: 352261:241343981b9b
user:      martin <martin%NetBSD.org@localhost>
date:      Thu Mar 23 08:18:17 2017 +0000

description:
Do not assume anything about the pseudo-disklabel of a completely zeroed
disk image. Use the raw partition and newfs -I instead.

diffstat:

 tests/fs/tmpfs/t_vnd.sh |  16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diffs (54 lines):

diff -r e0aab632a3c3 -r 241343981b9b tests/fs/tmpfs/t_vnd.sh
--- a/tests/fs/tmpfs/t_vnd.sh   Thu Mar 23 03:15:15 2017 +0000
+++ b/tests/fs/tmpfs/t_vnd.sh   Thu Mar 23 08:18:17 2017 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_vnd.sh,v 1.9 2016/07/29 05:23:24 pgoyette Exp $
+# $NetBSD: t_vnd.sh,v 1.10 2017/03/23 08:18:17 martin Exp $
 #
 # Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -28,6 +28,10 @@
 # Verifies that vnd works with files stored in tmpfs.
 #
 
+vnddev=vnd3
+rawpart=$( sysctl -n kern.rawpartition | tr '01234' 'abcde' )
+vnd=/dev/${vnddev}${rawpart}
+
 atf_test_case basic cleanup
 basic_head() {
        atf_set "descr" "Verifies that vnd works with files stored in tmpfs"
@@ -38,12 +42,12 @@
 
        atf_check -s eq:0 -o ignore -e ignore \
            dd if=/dev/zero of=disk.img bs=1m count=10
-       atf_check -s eq:0 -o empty -e empty vndconfig /dev/vnd3 disk.img
+       atf_check -s eq:0 -o empty -e empty vndconfig -c ${vnddev} disk.img
 
-       atf_check -s eq:0 -o ignore -e ignore newfs /dev/rvnd3a
+       atf_check -s eq:0 -o ignore -e ignore newfs -I ${vnd}
 
        atf_check -s eq:0 -o empty -e empty mkdir mnt
-       atf_check -s eq:0 -o empty -e empty mount /dev/vnd3a mnt
+       atf_check -s eq:0 -o empty -e empty mount ${vnd} mnt
 
        echo "Creating test files"
        for f in $(jot -w %u 100 | uniq); do
@@ -58,7 +62,7 @@
        done
 
        atf_check -s eq:0 -o empty -e empty umount mnt
-       atf_check -s eq:0 -o empty -e empty vndconfig -u /dev/vnd3
+       atf_check -s eq:0 -o empty -e empty vndconfig -u ${vnddev}
 
        test_unmount
        touch done
@@ -66,7 +70,7 @@
 basic_cleanup() {
        if [ ! -f done ]; then
                umount mnt 2>/dev/null 1>&2
-               vndconfig -u /dev/vnd3 2>/dev/null 1>&2
+               vndconfig -u ${vnddev} 2>/dev/null 1>&2
        fi
 }
 



Home | Main Index | Thread Index | Old Index