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

Add test for seg_start, seg_count, seg_start_pe

This commit is contained in:
Dave Wysochanski 2009-05-11 03:37:34 +00:00
parent 057983ce3e
commit 744ac0eb81

View File

@ -80,3 +80,22 @@ lvextend -l +100%PVS $vg/$lv $extend_pvs >out
grep "^ Logical volume $lv successfully resized\$" out
check_lv_field_ $vg/$lv lv_size "72.00M"
# Simple seg_count validation; initially create the LV with half the # of
# extents (should be 1 lv segment), extend it (should go to 2 segments),
# then reduce (should be back to 1)
# FIXME: test other segment fields such as seg_size, pvseg_start, pvseg_size
lvremove -f $vg/$lv
pe_count=$(pvs -o pv_pe_count --noheadings $dev1)
pe1=$(( $pe_count / 2 ))
lvcreate -l $pe1 -n $lv $vg
pesize=$(lvs -ovg_extent_size --units b --nosuffix --noheadings $vg/$lv)
segsize=$(( $pe1 * $pesize / 1024 / 1024 ))M
check_lv_field_ $vg/$lv seg_count 1
check_lv_field_ $vg/$lv seg_start 0
check_lv_field_ $vg/$lv seg_start_pe 0
#check_lv_field_ $vg/$lv seg_size $segsize
lvextend -l +$(( $pe_count * 1 )) $vg/$lv
check_lv_field_ $vg/$lv seg_count 2
lvreduce -f -l -$(( $pe_count * 1 )) $vg/$lv
check_lv_field_ $vg/$lv seg_count 1