mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-22 17:35:59 +03:00
tests: check cache stripe and raid behavior
Somehow raid tests landed in plain cache - separte them out so they properly check for have_raid. Check we do not support strip option with cache-pool creation.
This commit is contained in:
parent
a631fa20d0
commit
54c982081f
34
test/shell/lvcreate-cache-raid.sh
Normal file
34
test/shell/lvcreate-cache-raid.sh
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Copyright (C) 2015 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
# Exercise creation of cache and raids
|
||||||
|
|
||||||
|
. lib/inittest
|
||||||
|
|
||||||
|
test -e LOCAL_LVMPOLLD && skip
|
||||||
|
|
||||||
|
aux have_cache 1 3 0 || skip
|
||||||
|
aux have_raid 1 0 0 || skip
|
||||||
|
|
||||||
|
# FIXME: parallel cache metadata allocator is crashing when used value 8000!
|
||||||
|
aux prepare_vg 5 80000
|
||||||
|
|
||||||
|
aux lvmconf 'global/cache_disabled_features = [ "policy_smq" ]'
|
||||||
|
|
||||||
|
# Bug 1110026 & Bug 1095843
|
||||||
|
# Create RAID1 origin, then cache pool and cache
|
||||||
|
lvcreate -aey -l 2 --type raid1 -m1 -n $lv2 $vg
|
||||||
|
lvcreate --cache -l 1 $vg/$lv2
|
||||||
|
check lv_exists $vg/${lv2}_corig_rimage_0 # ensure images are properly renamed
|
||||||
|
check active $vg ${lv2}_corig
|
||||||
|
dmsetup table ${vg}-$lv2 | grep cache # ensure it is loaded in kernel
|
||||||
|
|
||||||
|
vgremove -ff $vg
|
@ -36,6 +36,8 @@ invalid lvcreate -H -l 1 --name $lv1 $vg
|
|||||||
invalid lvcreate -l 1 --cache $vg
|
invalid lvcreate -l 1 --cache $vg
|
||||||
# Only cached volume could be created
|
# Only cached volume could be created
|
||||||
invalid lvcreate -l 1 --type cache $vg
|
invalid lvcreate -l 1 --type cache $vg
|
||||||
|
# Striping is not supported with cache-pool creation
|
||||||
|
invalid lvcreate -l 1 -i 2 --type cache-pool $vg
|
||||||
# Fails as it needs to see VG content
|
# Fails as it needs to see VG content
|
||||||
fail lvcreate -l 1 --type cache --cachepool $vg/pool1
|
fail lvcreate -l 1 --type cache --cachepool $vg/pool1
|
||||||
fail lvcreate -l 1 --type cache --cachepool pool2 $vg
|
fail lvcreate -l 1 --type cache --cachepool pool2 $vg
|
||||||
@ -142,13 +144,6 @@ lvcreate -aey -l 2 -n $lv1 $vg
|
|||||||
lvcreate --type cache -l 1 $vg/$lv1
|
lvcreate --type cache -l 1 $vg/$lv1
|
||||||
dmsetup table ${vg}-$lv1 | grep cache # ensure it is loaded in kernel
|
dmsetup table ${vg}-$lv1 | grep cache # ensure it is loaded in kernel
|
||||||
|
|
||||||
# Bug 1110026 & Bug 1095843
|
|
||||||
# Create RAID1 origin, then cache pool and cache
|
|
||||||
lvcreate -aey -l 2 --type raid1 -m1 -n $lv2 $vg
|
|
||||||
lvcreate --cache -l 1 $vg/$lv2
|
|
||||||
check lv_exists $vg/${lv2}_corig_rimage_0 # ensure images are properly renamed
|
|
||||||
dmsetup table ${vg}-$lv2 | grep cache # ensure it is loaded in kernel
|
|
||||||
|
|
||||||
lvremove -f $vg
|
lvremove -f $vg
|
||||||
|
|
||||||
|
|
||||||
@ -168,6 +163,8 @@ lvremove -f $vg
|
|||||||
|
|
||||||
# writeable origin and 'default' => writable cache + origin
|
# writeable origin and 'default' => writable cache + origin
|
||||||
lvcreate -an -l1 -n $vg/$lv1
|
lvcreate -an -l1 -n $vg/$lv1
|
||||||
|
# do not allow stripping for cache-pool
|
||||||
|
fail lvcreate -H -i 2 -l1 -n cpool1 $vg/$lv1
|
||||||
lvcreate -H -l1 -n cpool1 $vg/$lv1
|
lvcreate -H -l1 -n cpool1 $vg/$lv1
|
||||||
check lv_attr_bit perm $vg/cpool1 "w"
|
check lv_attr_bit perm $vg/cpool1 "w"
|
||||||
check lv_attr_bit perm $vg/${lv1}_corig "w"
|
check lv_attr_bit perm $vg/${lv1}_corig "w"
|
||||||
@ -211,8 +208,9 @@ lvremove -f $vg
|
|||||||
lvcreate --type cache-pool -L10 --chunksize 256 --cachemode writeback $vg/cpool1
|
lvcreate --type cache-pool -L10 --chunksize 256 --cachemode writeback $vg/cpool1
|
||||||
check lv_field $vg/cpool1 chunksize "256.00k"
|
check lv_field $vg/cpool1 chunksize "256.00k"
|
||||||
check lv_field $vg/cpool1 cachemode "writeback"
|
check lv_field $vg/cpool1 cachemode "writeback"
|
||||||
lvcreate -H -L10 -n $lv1 $vg/cpool1
|
# check striping is supported when creating a cached LV
|
||||||
lvs -a -o+cachemode,chunksize $vg
|
lvcreate -H -L10 -i 2 -n $lv1 $vg/cpool1
|
||||||
|
check lv_field $vg/${lv1}_corig stripes "2" -a
|
||||||
check lv_field $vg/$lv1 chunksize "256.00k"
|
check lv_field $vg/$lv1 chunksize "256.00k"
|
||||||
check lv_field $vg/$lv1 cachemode "writeback"
|
check lv_field $vg/$lv1 cachemode "writeback"
|
||||||
|
|
||||||
@ -264,10 +262,4 @@ grep "chunk size" out
|
|||||||
# --poolmetadatasize
|
# --poolmetadatasize
|
||||||
# --poolmetadataspare
|
# --poolmetadataspare
|
||||||
|
|
||||||
lvremove -f $vg
|
|
||||||
lvcreate -n corigin -m 1 --type raid1 -l 10 $vg
|
|
||||||
lvcreate -n cpool -H $vg/corigin -l 10
|
|
||||||
check active $vg corigin_corig
|
|
||||||
dmsetup table | grep ^$PREFIX | grep corigin_corig
|
|
||||||
|
|
||||||
vgremove -ff $vg
|
vgremove -ff $vg
|
||||||
|
Loading…
Reference in New Issue
Block a user