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

tests: new lvconvert features

This commit is contained in:
Zdenek Kabelac 2014-07-11 12:15:46 +02:00
parent ee11bb8416
commit 653fd7bee3
3 changed files with 52 additions and 6 deletions

View File

@ -16,10 +16,50 @@ aux have_cache 1 3 0 || skip
aux prepare_vg 5 80
# lvcreate origin, lvcreate cache-pool, and lvconvert to cache
lvcreate -l 2 -n $lv1 $vg
lvcreate -L 2 -n $lv1 $vg
lvcreate -L 8 -n $lv2 $vg
lvcreate -L 8 -n $lv3 $vg
# undefined cachepool
invalid lvconvert --type cache --poolmetadata $vg/$lv2 $vg/$lv1
# cannot mix with thins
invalid lvconvert --type cache --poolmetadata $vg/$lv2 --thinpool $vg/$lv1
invalid lvconvert --type cache --thin --poolmetadata $vg/$lv2 $vg/$lv1
# undefined cached volume
invalid lvconvert --type cache --cachepool $vg/$lv1
invalid lvconvert --cache --cachepool $vg/$lv1
# single vg
invalid lvconvert --type cache --cachepool $vg/$lv1 --poolmetadata $vg1/$lv2 $vg/$lv3
invalid lvconvert --type cache --cachepool $vg/$lv1 --poolmetadata $lv2 $vg1/$lv3
invalid lvconvert --type cache --cachepool $vg1/$lv1 --poolmetadata $vg2/$lv2 $vg/$lv3
invalid lvconvert --cachepool $vg1/$lv1 --poolmetadata $vg2/$lv2
invalid lvconvert --type cache-pool --poolmetadata $vg2/$lv2 $vg1/$lv1
fail lvconvert --yes --type cache-pool --chunksize 16M --poolmetadata $lv2 $vg/$lv1
lvconvert --yes --type cache-pool --cachepool $vg/$lv1
#fail lvconvert --cachepool $vg/$lv1 --poolmetadata $vg/$lv2
#lvconvert --yes --type cache-pool --poolmetadata $vg/$lv2 $vg/$lv1
#lvconvert --yes --poolmetadata $vg/$lv2 --cachepool $vg/$lv1
lvremove -ff $vg
lvcreate -L 2 -n $lv1 $vg
lvcreate --type cache-pool -l 1 -n ${lv1}_cachepool $vg
lvconvert --type cache --cachepool $vg/${lv1}_cachepool $vg/$lv1
lvconvert --cache --cachepool $vg/${lv1}_cachepool $vg/$lv1
dmsetup table ${vg}-$lv1 | grep cache # ensure it is loaded in kernel
#lvconvert --cachepool $vg/${lv1}_cachepool $vg/$lv1
#lvconvert --cachepool $vg/${lv1}_cachepool --poolmetadatasize 20 "$dev3"
fail lvconvert --type cache --cachepool $vg/${lv1}_cachepool $vg/$lv1
lvremove -ff $vg
# Bug 1095843

View File

@ -109,7 +109,7 @@ lvchange -aey $vg
lvs -a -o+origin_size,seg_size $vg
# Chain external origins
lvconvert --originname extorg1 --thinpool $vg/pool -T $vg/extorg
lvconvert --type thin --originname extorg1 --thinpool $vg/pool $vg/extorg
check inactive $vg extorg1
lvconvert --originname extorg2 --thinpool $vg/pool -T $vg/extorg1

View File

@ -12,8 +12,7 @@
. lib/inittest
prepare_lvs()
{
prepare_lvs() {
lvremove -f $vg
lvcreate -L10M -n $lv1 $vg
lvcreate -L8M -n $lv2 $vg
@ -38,6 +37,13 @@ aux extend_filter_LVMTEST
pvcreate "$DM_DEV_DIR/$vg1/$lv"
vgcreate $vg -s 64K $(tail -n+4 DEVICES) "$DM_DEV_DIR/$vg1/$lv"
lvcreate -L1T -n $lv1 $vg
invalid lvconvert --yes -c 8M --type thin --poolmetadatasize 1G $vg/$lv1
# needs some --cachepool or --thinpool
invalid lvconvert --yes --poolmetadatasize 1G $vg/$lv1
lvremove -f $vg
# create mirrored LVs for data and metadata volumes
lvcreate -aey -L10M --type mirror -m1 --mirrorlog core -n $lv1 $vg
lvcreate -aey -L10M -n $lv2 $vg
@ -60,7 +66,7 @@ lvconvert --yes -c 64 --stripes 2 --thinpool $vg/$lv1 --readahead 48
lvremove -f $vg
lvcreate -L1T -n $lv1 $vg
lvconvert --yes -c 8M --thinpool $vg/$lv1
lvconvert --yes -c 8M --type thin-pool $vg/$lv1
lvremove -f $vg
# test with bigger sizes