diff --git a/test/shell/lvchange-thin.sh b/test/shell/lvchange-thin.sh index 96c4b3064..f2b33b778 100644 --- a/test/shell/lvchange-thin.sh +++ b/test/shell/lvchange-thin.sh @@ -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