From cc44e17c5e417bdc3cb0cefaef51b058fa7bb2c0 Mon Sep 17 00:00:00 2001 From: Petr Rockai Date: Tue, 11 Nov 2008 15:46:15 +0000 Subject: [PATCH] Add a bunch of sub-tests aimed at testing various bugzillas, by jstava. --- test/t-lvextend-percent-extents.sh | 8 ++++++++ test/t-metadata.sh | 20 ++++++++++++++++++++ test/t-pvcreate-operation.sh | 8 ++++++++ 3 files changed, 36 insertions(+) diff --git a/test/t-lvextend-percent-extents.sh b/test/t-lvextend-percent-extents.sh index 80cf4d2ea..e17078da2 100755 --- a/test/t-lvextend-percent-extents.sh +++ b/test/t-lvextend-percent-extents.sh @@ -30,6 +30,14 @@ lvextend $vg/$lv $dev1 >out grep "^ Logical volume $lv successfully resized\$" out check_pv_field_ $dev1 pv_free "0" +lvremove -f $vg/$lv + +# 'lvextend computes necessary free space correctly - bz213552' +vgsize=$(vgs -o vg_extent_count --noheadings) +lvcreate -l $vgsize -n $lv $vg +yes | lvreduce -l $(( $vgsize / 2 )) $vg/$lv +lvextend -l $vgsize $vg/$lv + # 'Reset LV to original size' lvremove -f $vg/$lv lvcreate -L 64M -n $lv $vg diff --git a/test/t-metadata.sh b/test/t-metadata.sh index d5e98b0cc..b96f7c301 100755 --- a/test/t-metadata.sh +++ b/test/t-metadata.sh @@ -28,6 +28,26 @@ pvchange --uuid $dev1 pvchange --uuid $dev2 vgremove -f $vg +# check that PVs without metadata don't cause too many full device rescans (bz452606) +for mdacp in 1 0; do + pvcreate --metadatacopies $mdacp $devs + pvcreate $dev1 + vgcreate $vg $devs + lvcreate -n $lv1 -l 2 -i5 -I256 $vg + lvcreate -n $lv2 -m2 -l 2 $vg + #lvchange -an $vg + lvchange -an $vg/$lv1 >out$mdacp 2>&1 + lvchange -an $vg/$lv2 >>out$mdacp 2>&1 + test ! -s out$mdacp + vgchange -ay $vg + lvchange -vvvv -an $vg/$lv1 >out$mdacp 2>&1 + lvchange -vvvv -an $vg/$lv2 >>out$mdacp 2>&1 + eval run$mdacp=$(wc -l err + grep "Can't open $dev1 exclusively. Mounted filesystem?" err + umount $dev1 + fi # pvcreate (lvm$mdatype) succeeds when run repeatedly (pv not in a vg) (bz178216) pvcreate -M$mdatype $dev1