1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-03 05:18:29 +03:00

tests: check kernel_cache_ funcs

This commit is contained in:
Zdenek Kabelac 2016-03-02 11:12:14 +01:00
parent e04a0184cb
commit 49839b6d96

View File

@ -1,5 +1,5 @@
#!/bin/sh
# Copyright (C) 2014 Red Hat, Inc. All rights reserved.
# Copyright (C) 2014-2016 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
@ -31,44 +31,52 @@ not lvchange --cachepolicy mq $vg/noncache
not lvchange --cachesettings foo=bar $vg/noncache
lvchange --cachepolicy cleaner $vg/corigin
dmsetup status | grep $vg-corigin | grep 'cleaner'
check lv_field $vg/corigin kernel_cache_policy "cleaner"
lvchange --cachepolicy mq --cachesettings migration_threshold=333 $vg/corigin
dmsetup status | grep $vg-corigin | not grep 'cleaner'
dmsetup status | grep $vg-corigin | grep 'mq'
dmsetup status | grep $vg-corigin | grep 'migration_threshold 333'
# 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'
lvchange --refresh $vg/corigin
dmsetup status | grep $vg-corigin | grep 'migration_threshold 333'
get lv_field $vg/corigin kernel_cache_settings | grep 'migration_threshold=333'
lvchange -an $vg
lvchange -ay $vg
dmsetup status | grep $vg-corigin | grep 'migration_threshold 333'
get lv_field $vg/corigin kernel_cache_settings | grep 'migration_threshold=333'
lvchange --cachesettings 'migration_threshold = 233 sequential_threshold = 13' $vg/corigin
dmsetup status | grep $vg-corigin | grep 'migration_threshold 233'
dmsetup status | grep $vg-corigin | grep 'sequential_threshold 13'
get lv_field $vg/corigin kernel_cache_settings | tee out
grep 'migration_threshold=233' out
grep 'sequential_threshold=13' out
lvchange --cachesettings 'migration_threshold = 17' $vg/corigin
dmsetup status | grep $vg-corigin | grep 'migration_threshold 17'
dmsetup status | grep $vg-corigin | grep 'sequential_threshold 13'
get lv_field $vg/corigin kernel_cache_settings | tee out
grep 'migration_threshold=17' out
grep 'sequential_threshold=13' out
lvchange --cachesettings 'migration_threshold = default' $vg/corigin
dmsetup status | grep $vg-corigin | grep 'migration_threshold 2048'
dmsetup status | grep $vg-corigin | grep 'sequential_threshold 13'
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 'random_threshold = default migration_threshold = default' $vg/corigin
dmsetup status | grep $vg-corigin | grep 'migration_threshold 2048'
dmsetup status | grep $vg-corigin | grep 'sequential_threshold 13'
dmsetup status | grep $vg-corigin | grep 'random_threshold 4'
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
dmsetup status | grep $vg-corigin | grep 'migration_threshold 233 '
dmsetup status | grep $vg-corigin | grep 'sequential_threshold 13 '
dmsetup status | grep $vg-corigin | grep 'random_threshold 1 '
get lv_field $vg/corigin kernel_cache_settings | tee out
grep 'migration_threshold=233' out
grep 'sequential_threshold=13' out
grep 'random_threshold=1' out
lvchange --cachesettings random_threshold=default --cachesettings migration_threshold=default $vg/corigin
dmsetup status | grep $vg-corigin | grep 'migration_threshold 2048 '
dmsetup status | grep $vg-corigin | grep 'sequential_threshold 13 '
dmsetup status | grep $vg-corigin | grep 'random_threshold 4 '
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
vgremove -f $vg