diff --git a/test/shell/lvs-cache.sh b/test/shell/lvs-cache.sh index a06a02360..2c518d045 100644 --- a/test/shell/lvs-cache.sh +++ b/test/shell/lvs-cache.sh @@ -22,6 +22,25 @@ SKIP_WITH_LVMPOLLD=1 aux have_cache 1 3 0 || skip aux prepare_vg 5 8000 +# Use 10M origin size +lvcreate -L10 -n $lv1 $vg +lvcreate -H -L5 $vg/$lv1 + +# replace 10M size with 5M size of cache device +NEWCLINE=$(dmsetup table $vg-$lv1 | sed 's/20480/10240/') +dmsetup reload $vg-$lv1 --table "$NEWCLINE" +dmsetup resume $vg-$lv1 + +# Check that mismatching cache target is shown by lvs +lvs -a $vg 2>&1 | grep "WARNING" +check lv_attr_bit state $vg/$lv1 "X" + +lvs -o+lv_active $vg + +lvremove -f $vg + + + lvcreate --type cache-pool -L10 $vg/cpool lvcreate --type cache -l 1 --cachepool $vg/cpool -n corigin $vg lvs -o lv_name,cache_policy