]> sourceware.org Git - lvm2.git/commitdiff
tests: check vdopool policy extension
authorZdenek Kabelac <zkabelac@redhat.com>
Tue, 22 Sep 2020 13:44:31 +0000 (15:44 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Tue, 22 Sep 2020 21:28:43 +0000 (23:28 +0200)
Check pool will grow even with small policy amount.

test/shell/lvextend-vdo.sh

index 5a68bb1576b69ac3a9089b90f4731a963dc3bc0f..2e9cee4f52a91b2425afd85394dac1bcebfd2fa7 100644 (file)
@@ -17,7 +17,9 @@ SKIP_WITH_LVMPOLLD=1
 
 aux have_vdo 6 2 0 || skip
 
-aux lvmconf 'allocation/vdo_slab_size_mb = 128'
+aux lvmconf "activation/vdo_pool_autoextend_percent = 1" \
+           "activation/vdo_pool_autoextend_threshold = 70" \
+           "allocation/vdo_slab_size_mb = 128"
 
 aux prepare_vg 1 7000
 lvcreate --vdo -V3G -L4G -n $lv1 $vg/$lv2
@@ -31,4 +33,22 @@ check lv_field $vg/${lv2}_vdata size "5.00g"
 lvextend -L+1G $vg/$lv1
 check lv_field $vg/$lv1 size "4.00g"
 
+lvremove -f $vg
+
+
+# Resize by policy
+lvcreate --vdo -V3G -L4G -n $lv1 $vg/$lv2
+
+# Fill VDO LV to match configured threshold >= 70%
+dd if=/dev/urandom of="$DM_DEV_DIR/$vg/$lv1" bs=1M count=60 oflag=direct
+PERCENT=$(get lv_field $vg/$lv2 data_percent | cut -d. -f1)
+test "$PERCENT" -ge "70"
+
+lvextend --use-policies "$vg/$lv2"
+
+# although autoextend is only 1%, it needs to extend at least by slab_size
+# this is corner case where min growth requires 128M + 128k
+check lv_field $vg/$lv2 size "<4.13g"
+
+
 vgremove -ff $vg
This page took 1.397921 seconds and 5 git commands to generate.