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

tests: extend vgmerge testing

(cherry picked from commit 8ebcbe9ace6e5c88a35cf62cd04b853ca7551a2b)
(cherry picked from commit 323257dfff9da36c77f22d7ef019f782c52591bf)
This commit is contained in:
Zdenek Kabelac 2021-07-23 16:34:50 +02:00 committed by Marian Csontos
parent c20978d76e
commit 6d3b3753d7

View File

@ -80,3 +80,45 @@ grep "Duplicate logical volume name \"$lv1\" in \"$vg2\" and \"$vg1" err
check pvlv_counts $vg1 2 1 0
check pvlv_counts $vg2 2 1 0
vgremove -f $vg1 $vg2
# 'vgmerge' handle pmspare for merged VG
if aux have_thin 1 5 0; then
# With disabled pmspare nothing is created
vgcreate $vg1 "$dev1" "$dev2"
vgcreate $vg2 "$dev3" "$dev4"
lvcreate -T -L8M $vg1/pool1 --poolmetadatasize 8M --poolmetadataspare n
lvcreate -T -L8M $vg2/pool2 --poolmetadatasize 4M --poolmetadataspare n
vgchange -an $vg1 $vg2
vgmerge --poolmetadataspare n $vg1 $vg2
check lv_not_exists $vg/lvol0_pmspare
vgremove -ff $vg1
# With pmspare handling there are one created
vgcreate $vg1 "$dev1" "$dev2"
vgcreate $vg2 "$dev3" "$dev4"
lvcreate -T -L8M $vg1/pool1 --poolmetadatasize 8M --poolmetadataspare n
lvcreate -T -L8M $vg2/pool2 --poolmetadatasize 4M --poolmetadataspare n
vgchange -an $vg1 $vg2
vgmerge $vg1 $vg2
check lv_field $vg1/lvol0_pmspare size "8.00m"
vgremove -ff $vg1
# When merged, bigger pmspare is preserved
vgcreate $vg1 "$dev1" "$dev2"
vgcreate $vg2 "$dev3" "$dev4"
lvcreate -T -L8M $vg1/pool1 --poolmetadatasize 8M
lvcreate -T -L8M $vg2/pool2 --poolmetadatasize 4M
vgchange -an $vg1 $vg2
vgmerge $vg1 $vg2
check lv_field $vg1/lvol0_pmspare size "8.00m"
vgremove -ff $vg1
fi