1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-27 18:55:19 +03:00

tests: updates

This commit is contained in:
Zdenek Kabelac 2014-03-28 00:39:55 +01:00
parent bd805ff048
commit a512ea6a6a
5 changed files with 18 additions and 21 deletions

View File

@ -78,7 +78,6 @@ should "$LVM_TEST_THIN_CHECK_CMD" "$DM_DEV_DIR/$vg/fixed"
# Swap repaired metadata back
lvconvert -y -f --poolmetadata $vg/fixed --thinpool $vg/pool
lvs -a $vg
# Activate pool - this should now work
should vgchange -ay $vg

View File

@ -26,8 +26,8 @@ _check_mlog()
not grep mlog out
}
aux lvmconf 'allocation/maximise_cling = 0'
aux lvmconf 'allocation/mirror_logs_require_separate_pvs = 1'
aux lvmconf "allocation/maximise_cling = 0" \
"allocation/mirror_logs_require_separate_pvs = 1"
# fail multiple devices

View File

@ -116,9 +116,9 @@ lvcreate -l 18 -n lv $vg "$dev1"
lvcreate --type raid1 -m 1 -l 100%FREE -n raid1 $vg "$dev1" "$dev2"
check lv_field $vg/raid1 size "9.00m"
# Ensure image size is the same as the RAID1 size
check lv_field $vg/raid1 size `lvs --noheadings -o size $vg/raid1_rimage_0`
check lv_field $vg/raid1 size $(get lv_field $vg/raid1_rimage_0 size -a)
# Amount remaining in dev2 should equal the amount taken by 'lv' in dev1
check pv_field "$dev2" pv_free `lvs --noheadings -o size $vg/lv`
check pv_field "$dev2" pv_free $(get lv_field $vg/lv size)
lvremove -ff $vg
# Eat 18 of 37 extents from dev1, leaving 19

View File

@ -20,7 +20,7 @@ aux disable_dev "$dev1"
pvscan
vgcreate $vg1 "$dev2"
aux enable_dev "$dev1"
pvs
pvs $(cat DEVICES)
# reappearing device (rhbz 995440)
lvcreate -aey -m2 --type mirror -l4 --alloc anywhere --corelog -n $lv1 $vg2
@ -30,7 +30,7 @@ lvconvert --yes --repair $vg2/$lv1
aux enable_dev "$dev3"
# here it should fix any reappeared devices
lvs
lvs $vg1 $vg1
lvs -a $vg2 -o+devices 2>&1 | tee out
not grep reappeared out

View File

@ -45,29 +45,27 @@ done
pvcreate --metadatacopies 0 "$dev1"
pvcreate --metadatacopies 2 "$dev2"
vgcreate $vg1 "$dev1" "$dev2"
pvchange -u "$dev1"
pvchange -u "$dev2"
check pvlv_counts $vg1 2 0 0
# -a needs more params
not pvchange -a
# -a is searching for devs, so passing it some is error
not pvchange -a "$dev1"
not pvchange -u "$dev1-notfound"
UUID=$(get pv_field "$dev1" uuid)
pvchange -u --all
# Checking for different UUID after pvchange
test "$UUID" != "$(get pv_field "$dev1" uuid)" || die "UUID has not changed!"
check pvlv_counts $vg1 2 0 0
# "pvchange rejects uuid change under an active lv"
# '-a' needs more params
invalid pvchange -a
# '-a' is searching for devs, so specifying device is invalid
invalid pvchange -a "$dev1"
fail pvchange -u "$dev1-notfound"
# pvchange rejects uuid change under an active lv
lvcreate -l 16 -i 2 -n $lv --alloc anywhere $vg1
check pvlv_counts $vg1 2 1 0
not pvchange -u "$dev1"
lvchange -an $vg1/$lv
pvchange -u "$dev1"
# "cleanup"
lvremove -f $vg1/$lv
vgremove $vg1
vgremove -f $vg1
# "pvchange reject --addtag to lvm1 pv"
pvcreate -M1 "$dev1"