mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-18 10:04:20 +03:00
tests: update thin
This commit is contained in:
parent
9ba9e99716
commit
935813457f
84
test/shell/lvconvert-thin-from-thick.sh
Normal file
84
test/shell/lvconvert-thin-from-thick.sh
Normal file
@ -0,0 +1,84 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Copyright (C) 2023 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
|
||||
# of the GNU General Public License v.2.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software Foundation,
|
||||
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
# Test conversion to thin volume from thick LVs
|
||||
|
||||
SKIP_WITH_LVMLOCKD=1
|
||||
SKIP_WITH_LVMPOLLD=1
|
||||
|
||||
export LVM_TEST_THIN_REPAIR_CMD=${LVM_TEST_THIN_REPAIR_CMD-/bin/false}
|
||||
|
||||
. lib/inittest
|
||||
|
||||
which mkfs.ext4 || skip
|
||||
which fsck || skip
|
||||
which thin_restore || skip
|
||||
aux have_thin 1 5 0 || skip
|
||||
|
||||
_convert_to_thin() {
|
||||
mkfs.ext4 -E nodiscard "$DM_DEV_DIR/$vg/$lv1"
|
||||
lvconvert --yes --type thin $vg/$lv1
|
||||
fsck -n "$DM_DEV_DIR/$vg/$lv1"
|
||||
check lv_field $vg/$lv1 segtype thin
|
||||
lvs -ao+segtype $vg
|
||||
lvremove -f $vg
|
||||
}
|
||||
|
||||
|
||||
#
|
||||
# Main
|
||||
#
|
||||
aux prepare_vg 2 6000
|
||||
|
||||
# error -> thin
|
||||
lvcreate --type error -Zn -L10 -n $lv1 $vg
|
||||
lvconvert --yes --type thin $vg/$lv1
|
||||
not dd if="$DM_DEV_DIR/$vg/$lv1" of=/dev/null bs=512 count=1
|
||||
lvremove -f $vg
|
||||
|
||||
# zero -> thin
|
||||
lvcreate --type zero -L2T -n $lv1 $vg
|
||||
lvconvert --yes --type thin $vg/$lv1
|
||||
lvremove -f $vg
|
||||
|
||||
# linear -> thin
|
||||
lvcreate -L10 -n $lv1 $vg
|
||||
_convert_to_thin
|
||||
|
||||
# raid1 -> thin
|
||||
if aux have_raid 1 7 0 ; then
|
||||
lvcreate --type raid1 -L10 -n $lv1 $vg
|
||||
_convert_to_thin
|
||||
fi
|
||||
|
||||
# cache -> thin
|
||||
if aux have_cache 1 3 0 ; then
|
||||
lvcreate -L10 -n $lv1 $vg
|
||||
lvcreate -H -L10 $vg/$lv1
|
||||
_convert_to_thin
|
||||
fi
|
||||
|
||||
# writecache -> thin
|
||||
if aux have_cache 1 3 0 ; then
|
||||
lvcreate -L10 -n $lv1 $vg
|
||||
lvcreate -an -L10 -n $lv2 $vg
|
||||
lvconvert --yes --type writecache --cachevol $lv2 $vg/$lv1
|
||||
_convert_to_thin
|
||||
fi
|
||||
|
||||
# vdo -> thin
|
||||
if aux have_vdo 6 2 0 ; then
|
||||
lvcreate --type vdo -L4G -n $lv1 $vg/$lv2
|
||||
_convert_to_thin
|
||||
fi
|
||||
|
||||
vgremove -ff $vg
|
@ -45,7 +45,7 @@ pvcreate "$DM_DEV_DIR/$vg1/$lv"
|
||||
vgcreate $vg -s 64K "$dev4" "$DM_DEV_DIR/$vg1/$lv"
|
||||
|
||||
lvcreate -L1T -n $lv1 $vg
|
||||
invalid lvconvert --yes -c 8M --type thin --poolmetadatasize 1G $vg/$lv1
|
||||
lvconvert --yes -c 8M --type thin --poolmetadatasize 1G $vg/$lv1
|
||||
|
||||
# needs some --cachepool or --thinpool
|
||||
invalid lvconvert --yes --poolmetadatasize 1G $vg/$lv1
|
||||
|
Loading…
x
Reference in New Issue
Block a user