1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

tests: enhance lvchange of thin pool tests

Validate also content of dmtable.
Check operations with unused thin-pool as well.
This commit is contained in:
Zdenek Kabelac 2016-09-19 13:49:32 +02:00
parent 1a30adc062
commit b3b8834724

View File

@ -23,7 +23,40 @@ aux prepare_pvs 3
vgcreate -s 128k $vg "$dev1" "$dev2"
vgcreate -s 128k $vg2 "$dev3"
lvcreate -V10M -L10M -T $vg/pool -n $lv1
lvcreate -L10M -T $vg/pool
#
# Check change operations on a thin-pool without any thin LV
#
# discards_ARG (default is passdown)
check grep_dmsetup status $vg-pool " discard_passdown"
lvchange -vvvv --discards nopassdown $vg/pool
check grep_dmsetup table $vg-pool " no_discard_passdown"
check grep_dmsetup status $vg-pool " no_discard_passdown"
lvchange --discards passdown $vg/pool
check grep_dmsetup table $vg-pool -v "passdown"
check grep_dmsetup status $vg-pool " discard_passdown"
# zero_ARG (default is 'yes')
check grep_dmsetup table $vg-pool -v "zeroing"
lvchange --zero n $vg/pool
check grep_dmsetup table $vg-pool " skip_block_zeroing"
lvchange --zero y $vg/pool
check grep_dmsetup table $vg-pool -v "zeroing"
# errorwhenfull_ARG (default is 'no')
check grep_dmsetup status $vg-pool "queue_if_no_space"
lvchange --errorwhenfull y $vg/pool
check grep_dmsetup status $vg-pool "error_if_no_space"
check grep_dmsetup table $vg-pool "error_if_no_space"
lvchange --errorwhenfull n $vg/pool
check grep_dmsetup status $vg-pool "queue_if_no_space"
check grep_dmsetup table $vg-pool -v "error_if_no_space"
# Attach thin volume
lvcreate -V10M -n $lv1 $vg/pool
lvcreate -L10M -n $lv2 $vg
lvchange -an $vg/$lv1
@ -73,11 +106,26 @@ lvchange --deltag foo $vg/pool
# discards_ARG
lvchange --discards nopassdown $vg/pool
check grep_dmsetup table $vg-pool-tpool " no_discard_passdown"
check grep_dmsetup status $vg-pool-tpool " no_discard_passdown"
lvchange --discards passdown $vg/pool
check grep_dmsetup table $vg-pool-tpool -v "passdown"
check grep_dmsetup status $vg-pool-tpool " discard_passdown"
# zero_ARG
lvchange --zero n $vg/pool
check grep_dmsetup table $vg-pool-tpool " skip_block_zeroing"
lvchange --zero y $vg/pool
check grep_dmsetup table $vg-pool-tpool -v "zeroing"
lvchange --errorwhenfull y $vg/pool
check grep_dmsetup status $vg-pool-tpool "error_if_no_space"
check grep_dmsetup table $vg-pool-tpool "error_if_no_space"
lvchange --errorwhenfull n $vg/pool
check grep_dmsetup status $vg-pool-tpool "queue_if_no_space"
check grep_dmsetup table $vg-pool-tpool -v "error_if_no_space"
#
# Test for disallowed metadata changes