Module Name:    src
Committed By:   martin
Date:           Wed Nov 30 17:49:09 UTC 2022

Modified Files:
        src/tests/dev/cgd: t_cgd.sh
        src/tests/dev/md: t_md.sh
        src/tests/dev/raidframe: t_raid.sh

Log Message:
Unfortunately rump does not provide the same magic as MAKEDEV does
for native /dev and create an alias for disk devices w/o partition
latter pointing at the raw partition, so for rump based tests we
actually have to calculate the concrete device name.

Use an idiom suggested by kre for this which also works for ports that
have kern.rawpartition > 4.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/tests/dev/cgd/t_cgd.sh
cvs rdiff -u -r1.7 -r1.8 src/tests/dev/md/t_md.sh
cvs rdiff -u -r1.15 -r1.16 src/tests/dev/raidframe/t_raid.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/dev/cgd/t_cgd.sh
diff -u src/tests/dev/cgd/t_cgd.sh:1.13 src/tests/dev/cgd/t_cgd.sh:1.14
--- src/tests/dev/cgd/t_cgd.sh:1.13	Wed Apr 10 06:13:21 2019
+++ src/tests/dev/cgd/t_cgd.sh	Wed Nov 30 17:49:09 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: t_cgd.sh,v 1.13 2019/04/10 06:13:21 kre Exp $
+#	$NetBSD: t_cgd.sh,v 1.14 2022/11/30 17:49:09 martin Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -25,7 +25,8 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-rawpart=`sysctl -n kern.rawpartition | tr '01234' 'abcde'`
+rawpart=$( set -- a b c d e f g h i j k l m n o p q r s t u v w x y z;
+	shift $( sysctl -n kern.rawpartition ); printf %s "$1" )
 rawcgd=/dev/rcgd0${rawpart}
 cgdserver=\
 "rump_server -lrumpvfs -lrumpkern_crypto -lrumpdev -lrumpdev_disk -lrumpdev_cgd"

Index: src/tests/dev/md/t_md.sh
diff -u src/tests/dev/md/t_md.sh:1.7 src/tests/dev/md/t_md.sh:1.8
--- src/tests/dev/md/t_md.sh:1.7	Sat May 14 17:42:28 2011
+++ src/tests/dev/md/t_md.sh	Wed Nov 30 17:49:09 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: t_md.sh,v 1.7 2011/05/14 17:42:28 jmmv Exp $
+#	$NetBSD: t_md.sh,v 1.8 2022/11/30 17:49:09 martin Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -25,7 +25,8 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-rawpart=`sysctl -n kern.rawpartition | tr '01234' 'abcde'`
+rawpart=$( set -- a b c d e f g h i j k l m n o p q r s t u v w x y z;
+	shift $( sysctl -n kern.rawpartition ); printf %s "$1" )
 rawmd=/dev/rmd0${rawpart}
 
 atf_test_case basic cleanup
@@ -38,10 +39,6 @@ basic_head()
 basic_body()
 {
 
-	# Scope out raw part.  This is actually the *host* raw partition,
-	# but just let it slide for now, since they *should* be the same.
-	rawpart=`sysctl -n kern.rawpartition | tr '01234' 'abcde'`
-
 	atf_check -s exit:0 $(atf_get_srcdir)/h_mdserv ${rawmd}
 
 	export RUMP_SERVER=unix://commsock

Index: src/tests/dev/raidframe/t_raid.sh
diff -u src/tests/dev/raidframe/t_raid.sh:1.15 src/tests/dev/raidframe/t_raid.sh:1.16
--- src/tests/dev/raidframe/t_raid.sh:1.15	Mon Nov 30 05:33:32 2020
+++ src/tests/dev/raidframe/t_raid.sh	Wed Nov 30 17:49:09 2022
@@ -1,5 +1,5 @@
 #! /usr/bin/atf-sh
-#	$NetBSD: t_raid.sh,v 1.15 2020/11/30 05:33:32 msaitoh Exp $
+#	$NetBSD: t_raid.sh,v 1.16 2022/11/30 17:49:09 martin Exp $
 #
 # Copyright (c) 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -26,7 +26,8 @@
 # POSSIBILITY OF SUCH DAMAGE.
 #
 
-rawpart=`sysctl -n kern.rawpartition | tr '01234' 'abcde'`
+rawpart=$( set -- a b c d e f g h i j k l m n o p q r s t u v w x y z;
+	shift $( sysctl -n kern.rawpartition ); printf %s "$1" )
 rawraid=/dev/rraid0${rawpart}
 raidserver="rump_server -lrumpvfs -lrumpdev -lrumpdev_disk -lrumpdev_raidframe"
 

Reply via email to