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

tests: support for resized cached LVs

Support for cached LVs is now enabled.
This commit is contained in:
Zdenek Kabelac 2021-02-07 18:45:43 +01:00
parent 4eeb9e7663
commit 0f074a4d65
2 changed files with 30 additions and 7 deletions

View File

@ -1,6 +1,6 @@
#!/usr/bin/env bash
# Copyright (C) 2017 Red Hat, Inc. All rights reserved.
# Copyright (C) 2017-2020 Red Hat, Inc. All rights reserved.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions
@ -22,15 +22,22 @@ export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
aux have_thin 1 0 0 || skip
aux have_cache 1 3 0 || skip
aux prepare_vg 2
aux prepare_vg 2 20000
lvcreate -l2 -T $vg/pool
lvcreate -l1 -T $vg/pool
# Caching of thin-pool's dataLV
lvcreate -H -L10 $vg/pool
# Resize is unsupported
not lvextend -l+2 $vg/pool 2>&1 | tee out
lvextend -l+2 $vg/pool
grep "Unable to resize" out
check lv_first_seg_field $vg/pool seg_size_pe "3"
lvextend -L10G $vg/pool
# Check data are resized and its metadata are matching data size
check lv_field $vg/pool size "10.00g"
check lv_field $vg/pool_tdata size "10.00g"
check lv_field $vg/pool_tdata_corig size "10.00g"
check lv_field $vg/pool_tmeta size "10.00m"
vgremove -ff $vg

View File

@ -22,6 +22,22 @@ aux have_thin 1 0 0 || skip
aux prepare_vg 3
lvcreate -i2 -l2 -T $vg/pool2
lvextend -l+2 $vg/pool2 "$dev2" "$dev3"
should lvextend -l+100%FREE $vg/pool2
lvextend -l+100%FREE $vg/pool2
lvremove -f $vg
lvcreate -L1 -n pool $vg
# Does work only with thin-pools
not lvextend --poolmetadatasize +1 $vg/pool
lvconvert -y --thinpool $vg/pool --poolmetadatasize 2
# _tdata cannot be used with --poolmetadata
not lvextend --poolmetadatasize +1 $vg/pool_tdata
lvextend --poolmetadatasize +1 $vg/pool_tmeta
lvextend --poolmetadatasize +1 --size +1 $vg/pool
check lv_field $vg/pool_tmeta size "4.00m"
check lv_field $vg/lvol0_pmspare size "4.00m"
not lvresize --poolmetadatasize -1 $vg/pool
vgremove -ff $vg