1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

Add more vgreduce tests. (Jaroslav Stava)

This commit is contained in:
Milan Broz 2008-09-19 16:12:25 +00:00
parent a240207505
commit 1ce760cb73

View File

@ -35,8 +35,6 @@ test_expect_success \
lv2=$(this_test_)-test-lv2-$$ &&
lv3=$(this_test_)-test-lv3-$$'
#TODO --removemissing (+ -- mirrorsonly)
for mdatype in 1 2
do
test_expect_success \
@ -92,6 +90,64 @@ test_expect_success \
vgremove -f $vg1
}
'
test_expect_success \
"cleanup" '
vgremove -ff $vg1; true
'
test_expect_success \
"(lvm$mdatype) setup: create mirror & damage one pv" '
vgcreate -M$mdatype $vg1 $d1 $d2 $d3 &&
lvcreate -n $lv1 -m1 -l 16 $vg1 &&
lvcreate -n $lv2 -l 16 $vg1 $d2 &&
lvcreate -n $lv3 -l 16 $vg1 $d3 &&
vgchange -an $vg1 &&
pvcreate -ff -y $d1
'
test_expect_success \
"(lvm$mdatype) vgreduce --removemissing --force repares to linear" '
vgreduce --removemissing --force $vg1 &&
check_lv_field_ $vg1/$lv1 segtype linear &&
vg_validate_pvlv_counts_ $vg1 2 3 0
'
test_expect_success \
"cleanup" '
vgremove -ff $vg1
'
test_expect_success \
"(lvm$mdatype) setup: create mirror + linear lvs" '
vgcreate -M$mdatype $vg1 $d1 &&
lvcreate -n $lv2 -l 16 $vg1 &&
lvcreate -n $lv1 -l 4 $vg1 &&
vgextend $vg1 $d2 $d3 &&
lvcreate -n $lv3 -l 16 $vg1 $d3 &&
lvconvert -m1 $vg1/$lv1
'
test_debug '
pvs --segments -o +lv_name
'
test_expect_success \
"(lvm$mdatype) setup: damage one pv" '
vgchange -an $vg1 &&
pvcreate -ff -y $d1
'
test_expect_failure \
"(lvm$mdatype) vgreduce rejects --removemissing --mirrorsonly --force when nonmirror lv lost too" '
vgreduce --removemissing --mirrorsonly --force $vg1
'
test_debug '
pvs -P
lvs -P
vgs -P
'
test_expect_success \
"cleanup" '
vgreduce --removemissing --force $vg1
vgremove -ff $vg1
'
done