1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-10-22 19:33:16 +03:00

A fairly extensive refactor of the mirror testing code. The exhaustive

lvconvert testing is now in its own test, t-lvconvert-mirror-basic ... it
doesn't do anything fancy but it does run lvconvert through a lot of
combinations.

I have also merged the remaining t-mirror-lvconvert tests into
t-lvconvert-mirror and abolished the former. The latter will be split again
later into more thematic divisions. (The previous split was rather arbitrary,
may I even say random...)
This commit is contained in:
Petr Rockai
2010-05-12 10:08:35 +00:00
parent 2400150734
commit d7eaafe9c1
7 changed files with 378 additions and 804 deletions

View File

@@ -94,7 +94,7 @@ prepare_testroot() {
trap_teardown
TESTDIR=$($abs_srcdir/mkdtemp ${LVM_TEST_DIR-$(pwd)} $PREFIX.XXXXXXXXXX) \
|| { echo "failed to create temporary directory in $test_dir_"; exit 1; }
|| { echo "failed to create temporary directory in ${LVM_TEST_DIR-$(pwd)}"; exit 1; }
export LVM_SYSTEM_DIR=$TESTDIR/etc
export DM_DEV_DIR=$TESTDIR/dev
@@ -131,6 +131,7 @@ teardown_devs() {
test -n "$LOOPFILE" && rm -f $LOOPFILE
fi
unset devs # devs is set in prepare_devs()
unset LOOP
}
teardown() {
@@ -178,7 +179,7 @@ prepare_loop() {
trap_teardown
for i in 0 1 2 3 4 5 6 7; do
mknod $DM_DEV_DIR/loop$i b 7 $i
test -e $DM_DEV_DIR/loop$i || mknod $DM_DEV_DIR/loop$i b 7 $i
done
LOOPFILE="$PWD/test.img"
@@ -291,16 +292,6 @@ prepare_devs() {
local name="${PREFIX}$pvname$i"
dmsetup table $name
done
# set up some default names
vg=${PREFIX}vg
vg1=${PREFIX}vg1
vg2=${PREFIX}vg2
lv=LV
lv1=LV1
lv2=LV2
lv3=LV3
lv4=LV4
}
disable_dev() {
@@ -346,10 +337,13 @@ restore_dev() {
prepare_pvs() {
prepare_devs "$@"
pvcreate $devs
pvcreate -ff $devs
}
prepare_vg() {
vgremove -ff $vg || true
teardown_devs
prepare_pvs "$@"
vgcreate -c n $vg $devs
pvs -v
@@ -400,6 +394,16 @@ prepare() {
prepare_testroot
prepare_lvmconf
prepare_clvmd
# set up some default names
vg=${PREFIX}vg
vg1=${PREFIX}vg1
vg2=${PREFIX}vg2
lv=LV
lv1=LV1
lv2=LV2
lv3=LV3
lv4=LV4
}
LANG=C