1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-30 01:47:56 +03:00

tests: check we recognize broken table entry

One (initial) test to recognize we see a mismatching
table entry for cache LV.
This commit is contained in:
Zdenek Kabelac 2016-12-01 10:45:37 +01:00
parent 36b211b464
commit 022d3af068

View File

@ -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