mirror of
git://sourceware.org/git/lvm2.git
synced 2025-01-09 01:18:39 +03:00
tests: update cache test
Since migration_threshold is now protected to not be smaller
then 8*chunk_size - update tests to count with this modification.
(cherry picked from commit 2cac4bfc15
)
This commit is contained in:
parent
c733e96445
commit
f633d68c54
@ -38,27 +38,27 @@ check lv_field $vg/corigin kernel_cache_policy "cleaner"
|
||||
# device-mapper: space map common: index_check failed: blocknr 17179869216 != wanted 11
|
||||
if aux have_cache 1 5 0 ; then
|
||||
|
||||
lvchange --cachepolicy mq --cachesettings migration_threshold=333 $vg/corigin
|
||||
lvchange --cachepolicy mq --cachesettings migration_threshold=1333 $vg/corigin
|
||||
|
||||
# TODO once mq->smq happens we will get here some 0 for mq settings
|
||||
check lv_field $vg/corigin kernel_cache_policy "mq"
|
||||
get lv_field $vg/corigin kernel_cache_settings | grep 'migration_threshold=333'
|
||||
get lv_field $vg/corigin kernel_cache_settings | grep 'migration_threshold=1333'
|
||||
|
||||
lvchange --refresh $vg/corigin
|
||||
get lv_field $vg/corigin kernel_cache_settings | grep 'migration_threshold=333'
|
||||
get lv_field $vg/corigin kernel_cache_settings | grep 'migration_threshold=1333'
|
||||
lvchange -an $vg
|
||||
lvchange -ay $vg
|
||||
get lv_field $vg/corigin kernel_cache_settings | grep 'migration_threshold=333'
|
||||
get lv_field $vg/corigin kernel_cache_settings | grep 'migration_threshold=1333'
|
||||
|
||||
lvchange --cachesettings 'migration_threshold = 233 sequential_threshold = 13' $vg/corigin
|
||||
lvchange --cachesettings 'migration_threshold = 1233 sequential_threshold = 13' $vg/corigin
|
||||
get lv_field $vg/corigin kernel_cache_settings | tee out
|
||||
grep 'migration_threshold=233' out
|
||||
grep 'migration_threshold=1233' out
|
||||
|
||||
if grep 'sequential_threshold=13' out ; then
|
||||
|
||||
lvchange --cachesettings 'migration_threshold = 17' $vg/corigin
|
||||
lvchange --cachesettings 'migration_threshold = 1117' $vg/corigin
|
||||
get lv_field $vg/corigin kernel_cache_settings | tee out
|
||||
grep 'migration_threshold=17' out
|
||||
grep 'migration_threshold=1117' out
|
||||
grep 'sequential_threshold=13' out
|
||||
|
||||
lvchange --cachesettings 'migration_threshold = default' $vg/corigin
|
||||
@ -66,16 +66,16 @@ get lv_field $vg/corigin kernel_cache_settings | tee out
|
||||
grep 'migration_threshold=2048' out
|
||||
grep 'sequential_threshold=13' out
|
||||
|
||||
lvchange --cachesettings 'migration_threshold = 233 sequential_threshold = 13 random_threshold = 1' $vg/corigin
|
||||
lvchange --cachesettings 'migration_threshold = 1233 sequential_threshold = 13 random_threshold = 1' $vg/corigin
|
||||
lvchange --cachesettings 'random_threshold = default migration_threshold = default' $vg/corigin
|
||||
get lv_field $vg/corigin kernel_cache_settings | tee out
|
||||
grep 'migration_threshold=2048' out
|
||||
grep 'sequential_threshold=13' out
|
||||
grep 'random_threshold=4' out
|
||||
|
||||
lvchange --cachesettings migration_threshold=233 --cachesettings sequential_threshold=13 --cachesettings random_threshold=1 $vg/corigin
|
||||
lvchange --cachesettings migration_threshold=1233 --cachesettings sequential_threshold=13 --cachesettings random_threshold=1 $vg/corigin
|
||||
get lv_field $vg/corigin kernel_cache_settings | tee out
|
||||
grep 'migration_threshold=233' out
|
||||
grep 'migration_threshold=1233' out
|
||||
grep 'sequential_threshold=13' out
|
||||
grep 'random_threshold=1' out
|
||||
|
||||
|
@ -256,20 +256,23 @@ lvdisplay --maps $vg
|
||||
|
||||
lvremove -f $vg
|
||||
|
||||
# migration_threshold is protected to not be smaller then 8*chunk_size
|
||||
# so even when user sets migration threshold to lower value,
|
||||
# activation will ensure the minimal size is preserved
|
||||
lvcreate --type cache-pool -L10 $vg/cpool
|
||||
lvcreate --type cache -l 1 --cachepool $vg/cpool -n corigin $vg --cachesettings migration_threshold=233
|
||||
lvcreate --type cache -l 1 --cachepool $vg/cpool -c 64k -n corigin $vg --cachesettings migration_threshold=233
|
||||
dmsetup status | grep $vg
|
||||
dmsetup status | grep $vg-corigin | grep 'migration_threshold 233'
|
||||
dmsetup status | grep $vg-corigin | grep 'migration_threshold 1024'
|
||||
lvchange -an $vg
|
||||
lvchange -ay $vg
|
||||
dmsetup status | grep $vg-corigin | grep 'migration_threshold 233'
|
||||
dmsetup status | grep $vg-corigin | grep 'migration_threshold 1024'
|
||||
|
||||
lvremove -f $vg
|
||||
|
||||
lvcreate --type cache-pool -L10 --cachepolicy mq --cachesettings migration_threshold=233 $vg/cpool
|
||||
lvcreate --type cache-pool -L10 --cachepolicy mq --cachesettings migration_threshold=1233 $vg/cpool
|
||||
lvcreate --type cache -l 1 --cachepool $vg/cpool -n corigin $vg
|
||||
dmsetup status | grep $vg
|
||||
dmsetup status | grep $vg-corigin | grep 'migration_threshold 233'
|
||||
dmsetup status | grep $vg-corigin | grep 'migration_threshold 1233'
|
||||
|
||||
lvremove -f $vg
|
||||
|
||||
@ -281,7 +284,7 @@ lvremove -f $vg
|
||||
# Creation of read-only cache pool is not supported
|
||||
invalid lvcreate -pr --type cache-pool -l1 -n $vg/cpool
|
||||
|
||||
# Atempt to use bigger chunk size then cache pool data size
|
||||
# Attempt to use bigger chunk size then cache pool data size
|
||||
fail lvcreate -l 1 --type cache-pool --chunksize 16M $vg 2>out
|
||||
grep "chunk size" out
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user