From 3a5d73beb06d0f9bf4b28862e3b661976656eaa1 Mon Sep 17 00:00:00 2001 From: Dave Wysochanski Date: Wed, 13 May 2009 19:18:47 +0000 Subject: [PATCH] Update test-utils to cope with ":" in device names and allow configurable names. --- test/test-utils.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/test-utils.sh b/test/test-utils.sh index daf2f5544..65b44e232 100644 --- a/test/test-utils.sh +++ b/test/test-utils.sh @@ -33,7 +33,7 @@ teardown() { test -n "$PREFIX" && { rm -rf $G_root_/dev/$PREFIX* while dmsetup table | grep -q ^$PREFIX; do - for s in `dmsetup table | grep ^$PREFIX| cut -f1 -d:`; do + for s in `dmsetup table | grep ^$PREFIX| awk '{ print substr($1,1,length($1)-1) }'`; do dmsetup resume $s 2>/dev/null > /dev/null || true dmsetup remove $s 2>/dev/null > /dev/null || true done @@ -99,6 +99,8 @@ prepare_devs() { test -z "$n" && n=3 local devsize="$2" test -z "$devsize" && devsize=33 + local pvname="$3" + test -z "$pvname" && pvname="pv" prepare_loop $(($n*$devsize)) @@ -111,7 +113,7 @@ prepare_devs() { local size=$(($loopsz/$n)) for i in `seq 1 $n`; do - local name="${PREFIX}pv$i" + local name="${PREFIX}$pvname$i" local dev="$G_dev_/mapper/$name" eval "dev$i=$dev" devs="$devs $dev"