1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00

Fix vgsplit and vgmerge tests for updated lv counting.

This commit is contained in:
Dave Wysochanski 2008-04-11 14:06:16 +00:00
parent fc7dfca452
commit 8388779937
3 changed files with 16 additions and 28 deletions

View File

@ -86,6 +86,18 @@ fi
return $(test $(lvs --noheadings -o $2 $1) == $3)
}
vg_validate_pvlv_counts_()
{
local local_vg=$1
local num_pvs=$2
local num_lvs=$3
local num_snaps=$4
check_vg_field_ $local_vg pv_count $num_pvs &&
check_vg_field_ $local_vg lv_count $num_lvs &&
check_vg_field_ $local_vg snap_count $num_snaps
}
dmsetup_has_dm_devdir_support_()
{
# Detect support for the envvar. If it's supported, the

View File

@ -23,18 +23,6 @@ cleanup_()
rm -f "$f1" "$f2" "$f3" "$f4"
}
vg_validate_pvlv_counts_()
{
local local_vg=$1
local num_pvs=$2
local num_lvs=$3
local num_snaps=$4
check_vg_field_ $local_vg pv_count $num_pvs &&
check_vg_field_ $local_vg lv_count $num_lvs &&
check_vg_field_ $local_vg snap_count $num_snaps
}
test_expect_success \
'set up temp files, loopback devices, PVs, vgnames' \
'f1=$(pwd)/1 && d1=$(loop_setup_ "$f1") &&
@ -81,10 +69,10 @@ test_expect_success \
lvcreate -l 16 -n $lv1 $vg1 &&
lvcreate -l 4 -s -n $lv2 $vg1/$lv1 &&
vgchange -an $vg1 &&
vg_validate_pvlv_counts_ $vg1 2 1 1 &&
vg_validate_pvlv_counts_ $vg1 2 2 1 &&
vg_validate_pvlv_counts_ $vg2 2 0 0 &&
vgmerge $vg2 $vg1 &&
vg_validate_pvlv_counts_ $vg2 4 1 1 &&
vg_validate_pvlv_counts_ $vg2 4 2 1 &&
lvremove -f $vg2/$lv2 &&
vgremove -f $vg2'
@ -94,10 +82,10 @@ test_expect_success \
vgcreate $vg2 $d4 &&
lvcreate -l 4 -n $lv1 -m1 $vg1 &&
vgchange -an $vg1 &&
vg_validate_pvlv_counts_ $vg1 3 4 0 &&
vg_validate_pvlv_counts_ $vg1 3 1 0 &&
vg_validate_pvlv_counts_ $vg2 1 0 0 &&
vgmerge $vg2 $vg1 &&
vg_validate_pvlv_counts_ $vg2 4 4 0 &&
vg_validate_pvlv_counts_ $vg2 4 1 0 &&
lvremove -f $vg2/$lv1 &&
vgremove -f $vg2'

View File

@ -24,18 +24,6 @@ cleanup_()
rm -f "$f1" "$f2" "$f3" "$f4" "$f5"
}
vg_validate_pvlv_counts_()
{
local local_vg=$1
local num_pvs=$2
local num_lvs=$3
local num_snaps=$4
check_vg_field_ $local_vg pv_count $num_pvs &&
check_vg_field_ $local_vg lv_count $num_lvs &&
check_vg_field_ $local_vg snap_count $num_snaps
}
# FIXME: paramaterize lvm1 vs lvm2 metadata; most of these tests should run
# fine with lvm1 metadata as well; for now, just add disks 5 and 6 as lvm1
# metadata