mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
tests: properly test with clustered VG
Testing in cluster makes sense only with clustered VG.
This commit is contained in:
parent
3aedaa7f2a
commit
8c7ec44bf0
@ -26,15 +26,15 @@ which md5sum || skip
|
||||
# Utilities
|
||||
|
||||
create_vg_() {
|
||||
vgcreate -c n -s 128k "$vg" "${DEVICES[@]}"
|
||||
vgcreate -s 128k "$vg" "${DEVICES[@]}"
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Common environment setup/cleanup for each sub testcases
|
||||
prepare_lvs_() {
|
||||
lvcreate -l2 -n $lv1 $vg "$dev1"
|
||||
lvcreate -aey -l2 -n $lv1 $vg "$dev1"
|
||||
check lv_on $vg $lv1 "$dev1"
|
||||
lvcreate -l9 -i3 -n $lv2 $vg "$dev2" "$dev3" "$dev4"
|
||||
lvcreate -aey -l9 -i3 -n $lv2 $vg "$dev2" "$dev3" "$dev4"
|
||||
check lv_on $vg $lv2 "$dev2" "$dev3" "$dev4"
|
||||
lvextend -l+2 $vg/$lv1 "$dev2"
|
||||
check lv_on $vg $lv1 "$dev1" "$dev2"
|
||||
@ -57,7 +57,7 @@ prepare_lvs_() {
|
||||
# original content should be preserved
|
||||
restore_lvs_() {
|
||||
vgcfgrestore -f bak-$$ $vg
|
||||
vgchange -ay $vg
|
||||
vgchange -aey $vg
|
||||
}
|
||||
|
||||
lvs_not_changed_() {
|
||||
@ -348,7 +348,7 @@ vgremove -ff $vg
|
||||
pvcreate "${DEVICES[@]}"
|
||||
pvcreate --metadatacopies 0 "$dev1" "$dev2"
|
||||
create_vg_
|
||||
lvcreate -l4 -n $lv1 $vg "$dev1"
|
||||
lvcreate -aey -l4 -n $lv1 $vg "$dev1"
|
||||
pvmove $mode "$dev1"
|
||||
|
||||
#COMM "pvmove fails activating mirror, properly restores state before pvmove"
|
||||
|
@ -22,7 +22,7 @@ aux have_raid 1 3 5 || skip
|
||||
aux prepare_pvs 5 20
|
||||
get_devs
|
||||
|
||||
vgcreate -c n -s 128k "$vg" "${DEVICES[@]}"
|
||||
vgcreate -s 128k "$vg" "${DEVICES[@]}"
|
||||
|
||||
for mode in "--atomic" ""
|
||||
do
|
||||
@ -33,8 +33,8 @@ do
|
||||
# 3) Move only the second LV by name
|
||||
|
||||
# Testing pvmove of RAID1 LV
|
||||
lvcreate -l 2 -n ${lv1}_foo $vg "$dev1"
|
||||
lvcreate --regionsize 16K -l 2 --type raid1 -m 1 -n $lv1 $vg "$dev1" "$dev2"
|
||||
lvcreate -aey -l 2 -n ${lv1}_foo $vg "$dev1"
|
||||
lvcreate -aey --regionsize 16K -l 2 --type raid1 -m 1 -n $lv1 $vg "$dev1" "$dev2"
|
||||
check lv_tree_on $vg ${lv1}_foo "$dev1"
|
||||
check lv_tree_on $vg $lv1 "$dev1" "$dev2"
|
||||
aux mkdev_md5sum $vg $lv1
|
||||
@ -49,8 +49,8 @@ check dev_md5sum $vg $lv1
|
||||
lvremove -ff $vg
|
||||
|
||||
# Testing pvmove of RAID10 LV
|
||||
lvcreate -l 2 -n ${lv1}_foo $vg "$dev1"
|
||||
lvcreate -l 4 --type raid10 -i 2 -m 1 -n $lv1 $vg \
|
||||
lvcreate -aey -l 2 -n ${lv1}_foo $vg "$dev1"
|
||||
lvcreate -aey -l 4 --type raid10 -i 2 -m 1 -n $lv1 $vg \
|
||||
"$dev1" "$dev2" "$dev3" "$dev4"
|
||||
check lv_tree_on $vg ${lv1}_foo "$dev1"
|
||||
check lv_tree_on $vg $lv1 "$dev1" "$dev2" "$dev3" "$dev4"
|
||||
@ -75,8 +75,8 @@ check dev_md5sum $vg $lv1
|
||||
lvremove -ff $vg
|
||||
|
||||
# Testing pvmove of RAID5 LV
|
||||
lvcreate -l 2 -n ${lv1}_foo $vg "$dev1"
|
||||
lvcreate -l 4 --type raid5 -i 2 -n $lv1 $vg \
|
||||
lvcreate -aey -l 2 -n ${lv1}_foo $vg "$dev1"
|
||||
lvcreate -aey -l 4 --type raid5 -i 2 -n $lv1 $vg \
|
||||
"$dev1" "$dev2" "$dev3"
|
||||
check lv_tree_on $vg ${lv1}_foo "$dev1"
|
||||
check lv_tree_on $vg $lv1 "$dev1" "$dev2" "$dev3"
|
||||
|
@ -24,7 +24,7 @@ aux have_raid 1 3 5 || skip
|
||||
aux prepare_pvs 5 20
|
||||
get_devs
|
||||
|
||||
vgcreate -c n -s 128k "$vg" "${DEVICES[@]}"
|
||||
vgcreate -s 128k "$vg" "${DEVICES[@]}"
|
||||
|
||||
for mode in "--atomic" ""
|
||||
do
|
||||
@ -37,8 +37,8 @@ do
|
||||
|
||||
|
||||
# Testing pvmove of thin LV
|
||||
lvcreate -l 2 -n ${lv1}_foo $vg "$dev1"
|
||||
lvcreate -T $vg/${lv1}_pool -l 4 -V 8 -n $lv1 "$dev1"
|
||||
lvcreate -aey -l 2 -n ${lv1}_foo $vg "$dev1"
|
||||
lvcreate -aey -T $vg/${lv1}_pool -l 4 -V 8 -n $lv1 "$dev1"
|
||||
check lv_tree_on $vg ${lv1}_foo "$dev1"
|
||||
check lv_tree_on $vg $lv1 "$dev1"
|
||||
aux mkdev_md5sum $vg $lv1
|
||||
@ -53,12 +53,12 @@ check dev_md5sum $vg $lv1
|
||||
lvremove -ff $vg
|
||||
|
||||
# Testing pvmove of thin LV on RAID
|
||||
lvcreate -l 2 -n ${lv1}_foo $vg "$dev1"
|
||||
lvcreate --type raid1 -m 1 -l 4 -n ${lv1}_raid1_pool $vg "$dev1" "$dev2"
|
||||
lvcreate --type raid1 -m 1 -L 2 -n ${lv1}_raid1_meta $vg "$dev1" "$dev2"
|
||||
lvcreate -aey -l 2 -n ${lv1}_foo $vg "$dev1"
|
||||
lvcreate -aey --type raid1 -m 1 -l 4 -n ${lv1}_raid1_pool $vg "$dev1" "$dev2"
|
||||
lvcreate -aey --type raid1 -m 1 -L 2 -n ${lv1}_raid1_meta $vg "$dev1" "$dev2"
|
||||
lvconvert --yes --thinpool $vg/${lv1}_raid1_pool \
|
||||
--poolmetadata ${lv1}_raid1_meta
|
||||
lvcreate -T $vg/${lv1}_raid1_pool -V 8 -n $lv1
|
||||
lvcreate -aey -T $vg/${lv1}_raid1_pool -V 8 -n $lv1
|
||||
check lv_tree_on $vg ${lv1}_foo "$dev1"
|
||||
check lv_tree_on $vg $lv1 "$dev1" "$dev2"
|
||||
aux mkdev_md5sum $vg $lv1
|
||||
|
Loading…
Reference in New Issue
Block a user