1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

tests: make test independent on usage [] for hidden LVs

This commit is contained in:
Zdenek Kabelac 2016-04-22 12:51:54 +02:00
parent 4ddf5a11cf
commit 2dc6b97856
5 changed files with 31 additions and 29 deletions

View File

@ -37,11 +37,11 @@ lv_devices_() {
}
lv_mirror_log_() {
test $(get lv_field $1 mirror_log) = $2
get lv_field $1 mirror_log | tr -d []
}
lv_convert_lv_() {
get lv_field $1 convert_lv
get lv_field $1 convert_lv | tr -d []
}
enable_devs() {
@ -87,7 +87,7 @@ lvcreate -an -Zn -l2 --type mirror -m1 -n $lv1 $vg
lv_devices_ $vg/$lv1 ${lv1}_mimage_0 ${lv1}_mimage_1
#COMM "mirror log is ${lv1}_mlog"
lv_mirror_log_ $vg/$lv1 ${lv1}_mlog
test $(lv_mirror_log_ $vg/$lv1) = ${lv1}_mlog
# "cleanup"
check_and_cleanup_lvs_

View File

@ -53,8 +53,8 @@ pvmove --abort "$dev1"
# check if proper pvmove was canceled
get lv_field $vg name -a | tee out
not grep "^pvmove0" out
grep "^pvmove1" out
not egrep "^\[?pvmove0" out
egrep "^\[?pvmove1" out
fi

View File

@ -89,13 +89,13 @@ test_pvmove_resume() {
aux enable_dev "$dev4"
i=0
while get lv_field $vg name -a | grep "^pvmove"; do
while get lv_field $vg name -a | egrep "^\[?pvmove"; do
# wait for 30 secs at max
test $i -ge 300 && die "Pvmove is too slow or does not progress."
sleep .1
i=$((i + 1))
done
while get lv_field $vg1 name -a | grep "^pvmove"; do
while get lv_field $vg1 name -a | egrep "^\[?pvmove"; do
# wait for 30 secs at max
test $i -ge 300 && die "Pvmove is too slow or does not progress."
sleep .1
@ -171,8 +171,8 @@ pvmove_fg() {
fi
# ...thus finish polling
get lv_field $vg name -a | grep "^pvmove0"
get lv_field $vg1 name -a | grep "^pvmove0"
get lv_field $vg name -a | egrep "^\[?pvmove0"
get lv_field $vg1 name -a | egrep "^\[?pvmove0"
# disable delay device
# fg pvmove would take ages to complete otherwise
@ -196,8 +196,8 @@ pvmove_bg() {
fi
# ...thus finish polling
get lv_field $vg name -a | grep "^pvmove0"
get lv_field $vg1 name -a | grep "^pvmove0"
get lv_field $vg name -a | egrep "^\[?pvmove0"
get lv_field $vg1 name -a | egrep "^\[?pvmove0"
LVM_TEST_TAG="kill_me_$PREFIX" pvmove -b -i0
}
@ -216,8 +216,8 @@ pvmove_fg_single() {
fi
# ...thus finish polling
get lv_field $vg name -a | grep "^pvmove0"
get lv_field $vg1 name -a | grep "^pvmove0"
get lv_field $vg name -a | egrep "^\[?pvmove0"
get lv_field $vg1 name -a | egrep "^\[?pvmove0"
# disable delay device
# fg pvmove would take ages to complete otherwise
@ -242,8 +242,8 @@ pvmove_bg_single() {
fi
# ...thus finish polling
get lv_field $vg name -a | grep "^pvmove0"
get lv_field $vg1 name -a | grep "^pvmove0"
get lv_field $vg name -a | egrep "^\[?pvmove0"
get lv_field $vg1 name -a | egrep "^\[?pvmove0"
LVM_TEST_TAG="kill_me_$PREFIX" pvmove -b "$dev1"
LVM_TEST_TAG="kill_me_$PREFIX" pvmove -b "$dev2"

View File

@ -129,7 +129,7 @@ pvmove_fg() {
fi
# ...thus finish polling
get lv_field $vg name -a | grep "^pvmove0"
get lv_field $vg name -a | egrep "^\[?pvmove0"
aux enable_dev "$dev2"
@ -149,7 +149,7 @@ pvmove_bg() {
fi
# ...thus finish polling
get lv_field $vg name -a | grep "^pvmove0"
get lv_field $vg name -a | egrep "^\[?pvmove0"
LVM_TEST_TAG="kill_me_$PREFIX" pvmove -b
}
@ -167,7 +167,7 @@ pvmove_fg_single() {
fi
# ...thus finish polling
get lv_field $vg name -a | grep "^pvmove0"
get lv_field $vg name -a | egrep "^\[?pvmove0"
aux enable_dev "$dev2"
@ -187,7 +187,7 @@ pvmove_bg_single() {
fi
# ...thus finish polling
get lv_field $vg name -a | grep "^pvmove0"
get lv_field $vg name -a | egrep "^\[?pvmove0"
LVM_TEST_TAG="kill_me_$PREFIX" pvmove -b "$dev1"
}

View File

@ -15,7 +15,7 @@
# Multisegment variant w/ 2 pvmoves LVs per VG
SKIP_WITH_LVMLOCKD=1
SKIP_WITH_CLVMD=1
#SKIP_WITH_CLVMD=1
. lib/inittest
@ -89,7 +89,7 @@ test_pvmove_resume() {
aux enable_dev "$dev5"
i=0
while get lv_field $vg name -a | grep "^pvmove"; do
while get lv_field $vg name -a | grep "^\[?pvmove"; do
# wait for 30 secs at max
test $i -ge 300 && die "Pvmove is too slow or does not progress."
sleep .1
@ -99,6 +99,8 @@ test_pvmove_resume() {
aux kill_tagged_processes
lvremove -ff $vg
# drop debug logs from killed lvm2 commands
rm -f debug.log_DEBUG*
}
lvchange_single() {
@ -145,8 +147,8 @@ pvmove_fg() {
fi
# ...thus finish polling
get lv_field $vg name -a | grep "^pvmove0"
get lv_field $vg name -a | grep "^pvmove1"
get lv_field $vg name -a | egrep "^\[?pvmove0"
get lv_field $vg name -a | egrep "^\[?pvmove1"
# disable delay device
# fg pvmove would take ages to complete otherwise
@ -170,8 +172,8 @@ pvmove_bg() {
fi
# ...thus finish polling
get lv_field $vg name -a | grep "^pvmove0"
get lv_field $vg name -a | grep "^pvmove1"
get lv_field $vg name -a | egrep "^\[?pvmove0"
get lv_field $vg name -a | egrep "^\[?pvmove1"
LVM_TEST_TAG="kill_me_$PREFIX" pvmove -b
}
@ -190,8 +192,8 @@ pvmove_fg_single() {
fi
# ...thus finish polling
get lv_field $vg name -a | grep "^pvmove0"
get lv_field $vg name -a | grep "^pvmove1"
get lv_field $vg name -a | egrep "^\[?pvmove0"
get lv_field $vg name -a | egrep "^\[?pvmove1"
# disable delay device
# fg pvmove would take ages to complete otherwise
@ -216,8 +218,8 @@ pvmove_bg_single() {
fi
# ...thus finish polling
get lv_field $vg name -a | grep "^pvmove0"
get lv_field $vg name -a | grep "^pvmove1"
get lv_field $vg name -a | egrep "^\[?pvmove0"
get lv_field $vg name -a | egrep "^\[?pvmove1"
LVM_TEST_TAG="kill_me_$PREFIX" pvmove -b "$dev1"
LVM_TEST_TAG="kill_me_$PREFIX" pvmove -b "$dev3"