mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-03 05:18:29 +03:00
tests: use swapmetadata
and some other pool/cache/thin related changes
This commit is contained in:
parent
0fa39f42e3
commit
9bbcefcffa
@ -61,7 +61,7 @@ check lv_field $vg/$lv2 cache_settings "random_threshold=56,sequential_threshold
|
||||
# Check swap of cache pool metadata
|
||||
lvconvert --yes --type cache-pool --poolmetadata $lv4 $vg/$lv3
|
||||
UUID=$(get lv_field $vg/$lv5 uuid)
|
||||
lvconvert --yes --cachepool $vg/$lv3 --poolmetadata $lv5
|
||||
lvconvert --yes --swapmetadata --poolmetadata $lv5 $vg/$lv3
|
||||
check lv_field $vg/${lv3}_cmeta uuid "$UUID"
|
||||
|
||||
|
||||
@ -109,30 +109,30 @@ lvcreate -an -Zn -L 8 -n $lv4 $vg
|
||||
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
|
||||
not lvconvert --type cache --poolmetadata $vg/$lv2 --thinpool $vg/$lv1
|
||||
not 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
|
||||
not lvconvert --type cache --cachepool $vg/$lv1
|
||||
not lvconvert --cache --cachepool $vg/$lv1
|
||||
|
||||
# Single vg is required
|
||||
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 --type cache-pool --poolmetadata $vg2/$lv2 $vg1/$lv1
|
||||
not lvconvert --type cache --cachepool $vg/$lv1 --poolmetadata $vg1/$lv2 $vg/$lv3
|
||||
not lvconvert --type cache --cachepool $vg/$lv1 --poolmetadata $lv2 $vg1/$lv3
|
||||
not lvconvert --type cache --cachepool $vg1/$lv1 --poolmetadata $vg2/$lv2 $vg/$lv3
|
||||
not lvconvert --type cache-pool --poolmetadata $vg2/$lv2 $vg1/$lv1
|
||||
|
||||
invalid lvconvert --cachepool $vg1/$lv1 --poolmetadata $vg2/$lv2
|
||||
not lvconvert --cachepool $vg1/$lv1 --poolmetadata $vg2/$lv2
|
||||
|
||||
# Invalid syntax, vg is unknown
|
||||
invalid lvconvert --yes --cachepool $lv3 --poolmetadata $lv4
|
||||
not lvconvert --yes --cachepool $lv3 --poolmetadata $lv4
|
||||
|
||||
# Invalid chunk size is <32KiB >1GiB
|
||||
invalid lvconvert --type cache-pool --chunksize 16 --poolmetadata $lv2 $vg/$lv1
|
||||
invalid lvconvert --type cache-pool --chunksize 2G --poolmetadata $lv2 $vg/$lv1
|
||||
not lvconvert --type cache-pool --chunksize 16 --poolmetadata $lv2 $vg/$lv1
|
||||
not lvconvert --type cache-pool --chunksize 2G --poolmetadata $lv2 $vg/$lv1
|
||||
|
||||
# Invalid chunk size is bigger then data size, needs to open VG
|
||||
fail lvconvert --yes --type cache-pool --chunksize 16M --poolmetadata $lv2 $vg/$lv1
|
||||
not lvconvert --yes --type cache-pool --chunksize 16M --poolmetadata $lv2 $vg/$lv1
|
||||
|
||||
lvremove -f $vg
|
||||
|
||||
@ -143,7 +143,7 @@ lvcreate --type cache-pool -an -v -L 2 -n cpool $vg
|
||||
lvcreate -H -L 4 -n corigin --cachepool $vg/cpool
|
||||
|
||||
# unsupported yet
|
||||
fail lvconvert --repair $vg/cpool 2>&1 | tee out
|
||||
not lvconvert --repair $vg/cpool 2>&1 | tee out
|
||||
#grep "Cannot convert internal LV" out
|
||||
|
||||
lvremove -f $vg
|
||||
@ -155,13 +155,13 @@ lvcreate --type cache-pool -L10 $vg/$lv1
|
||||
lvcreate --cache -L20 $vg/$lv1
|
||||
lvcreate -L10 -n $lv2 $vg
|
||||
|
||||
fail lvconvert --yes --type cache $vg/$lv2 --cachepool $vg/$lv1
|
||||
fail lvconvert --yes --type cache $vg/$lv1 --cachepool $vg/$lv2
|
||||
fail lvconvert --yes --type cache-pool $vg/$lv1
|
||||
fail lvconvert --yes --type mirror -m1 $vg/$lv1
|
||||
not lvconvert --yes --type cache $vg/$lv2 --cachepool $vg/$lv1
|
||||
not lvconvert --yes --type cache $vg/$lv1 --cachepool $vg/$lv2
|
||||
not lvconvert --yes --type cache-pool $vg/$lv1
|
||||
not lvconvert --yes --type mirror -m1 $vg/$lv1
|
||||
not aux have_raid 1 0 0 || fail lvconvert --yes --type raid1 -m1 $vg/$lv1
|
||||
fail lvconvert --yes --type snapshot $vg/$lv1 $vg/$lv2
|
||||
fail lvconvert --yes --type snapshot $vg/$lv2 $vg/$lv1
|
||||
not lvconvert --yes --type snapshot $vg/$lv1 $vg/$lv2
|
||||
not lvconvert --yes --type snapshot $vg/$lv2 $vg/$lv1
|
||||
not aux have_thin 1 0 0 || fail lvconvert --yes -T --thinpool $vg/$lv2 $vg/$lv1
|
||||
|
||||
lvremove -f $vg
|
||||
|
@ -45,7 +45,7 @@ lvchange -an $vg/$lv2 $vg/$lv1 $vg/pool $vg/repair
|
||||
|
||||
# Manual repair steps:
|
||||
# Test swapping - swap out thin-pool's metadata with our repair volume
|
||||
lvconvert -y -f --poolmetadata $vg/repair --thinpool $vg/pool
|
||||
lvconvert -y -f --swapmetadata --poolmetadata $vg/repair $vg/pool
|
||||
|
||||
lvchange -ay $vg/repair
|
||||
|
||||
@ -74,7 +74,7 @@ not "$LVM_TEST_THIN_DUMP_CMD" "$DM_DEV_DIR/$vg/repair" | tee dump
|
||||
lvchange -an $vg
|
||||
|
||||
# Swap repaired metadata back
|
||||
lvconvert -y -f --poolmetadata $vg/fixed --thinpool $vg/pool
|
||||
lvconvert -y -f --swapmetadata --poolmetadata $vg/fixed $vg/pool
|
||||
|
||||
# Check pool still preserves its original settings
|
||||
check lv_field $vg/pool chunksize "128.00k"
|
||||
@ -87,7 +87,7 @@ vgchange -ay $vg
|
||||
vgchange -an $vg
|
||||
|
||||
# Put back 'broken' metadata
|
||||
lvconvert -y -f --poolmetadata $vg/repair --thinpool $vg/pool
|
||||
lvconvert -y -f --swapmetadata --poolmetadata $vg/repair $vg/pool
|
||||
|
||||
# Check --repair usage
|
||||
lvconvert -v --repair $vg/pool
|
||||
@ -98,7 +98,7 @@ lvchange -ay $vg/pool
|
||||
vgchange -an $vg
|
||||
|
||||
# Restore damaged metadata
|
||||
lvconvert -y -f --poolmetadata $vg/pool_meta0 --thinpool $vg/pool
|
||||
lvconvert -y -f --swapmetadata --poolmetadata $vg/pool_meta0 $vg/pool
|
||||
|
||||
# Check lvremove -ff works even with damaged pool
|
||||
lvremove -ff $vg
|
||||
|
@ -40,7 +40,7 @@ lvchange -an $vg
|
||||
|
||||
lvcreate -L2M -n $lv1 $vg
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
lvconvert -y --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
|
||||
# Cannot resize if set to 0%
|
||||
not lvextend --use-policies --config 'activation{thin_pool_autoextend_percent = 0}' $vg/pool 2>&1 | tee err
|
||||
|
@ -78,7 +78,7 @@ fake_metadata_ 400 2 >data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
|
||||
# Swap volume with restored fake metadata
|
||||
lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
lvconvert -y --chunksize 64k --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
|
||||
# Not alllowed when thin-pool metadata free space is <75% for 2M meta
|
||||
fail lvcreate -V20 $vg/pool
|
||||
@ -91,7 +91,7 @@ lvchange -an $vg/pool
|
||||
fake_metadata_ 7400 2 >data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv2"
|
||||
# Swap volume with restored fake metadata
|
||||
lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv2
|
||||
lvconvert -y --chunksize 64k --swapmetadata --poolmetadata $vg/$lv2 $vg/pool
|
||||
lvchange -ay $vg/pool
|
||||
# Check generated metadata consume more then 88%
|
||||
test "$(meta_percent_)" -gt "88"
|
||||
@ -138,7 +138,7 @@ lvchange -an $vg/thin $vg/thin2 $vg/pool
|
||||
# Transaction_id is lower by 1 and there are no messages -> ERROR
|
||||
fake_metadata_ 10 0 >data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
lvconvert -y --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
not vgchange -ay $vg 2>&1 | tee out
|
||||
grep expected out
|
||||
|
||||
@ -147,7 +147,7 @@ check inactive $vg pool_tmeta
|
||||
# Transaction_id is higher by 1
|
||||
fake_metadata_ 10 3 >data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
lvconvert -y --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
not vgchange -ay $vg 2>&1 | tee out
|
||||
grep expected out
|
||||
|
||||
@ -158,7 +158,7 @@ fake_metadata_ 400 2 >data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
|
||||
# Swap volume with restored fake metadata
|
||||
lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
lvconvert -y --chunksize 64k --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
|
||||
vgchange -ay $vg
|
||||
|
||||
@ -173,7 +173,7 @@ fake_metadata_ 350 2 >data
|
||||
lvchange -ay $vg/$lv1
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
|
||||
lvconvert -y --chunksize 64k --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
lvconvert -y --chunksize 64k --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
lvchange -ay $vg/pool $vg/$lv1
|
||||
lvs -a $vg
|
||||
|
||||
|
@ -71,7 +71,7 @@ aux prepare_thin_metadata 490 1 | tee data
|
||||
"$LVM_TEST_THIN_RESTORE_CMD" -i data -o "$DM_DEV_DIR/mapper/$vg-$lv1"
|
||||
|
||||
# Swap volume with restored fake metadata
|
||||
lvconvert -y --thinpool $vg/pool --poolmetadata $vg/$lv1
|
||||
lvconvert -y --swapmetadata --poolmetadata $vg/$lv1 $vg/pool
|
||||
|
||||
lvchange -ay $vg
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user