1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-18 10:04:20 +03:00

Update test-utils to cope with ":" in device names and allow configurable names.

This commit is contained in:
Dave Wysochanski 2009-05-13 19:18:47 +00:00
parent cfebc626b6
commit 3a5d73beb0

View File

@ -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"