1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

tests: happy using of 4K backend devices

When the backend device supports only 4K blocks (like ramdisk)
we cannot use for testing any smaller blocksize.

So recalc test for 4K extent size.

We may possibly introduce one list extra test that
can be executed on devices with 512b sectors to
check lvm2 support those min extent sizes...
This commit is contained in:
Zdenek Kabelac 2018-05-12 15:58:13 +02:00
parent e2be14e2d5
commit 6f48741062
4 changed files with 20 additions and 20 deletions

View File

@ -20,7 +20,7 @@ SKIP_WITH_LVMPOLLD=1
aux prepare_pvs 2 aux prepare_pvs 2
get_devs get_devs
vgcreate -s 1k "$vg" "${DEVICES[@]}" vgcreate -s 4k "$vg" "${DEVICES[@]}"
lvcreate --type snapshot -V50 -L1 -n $lv1 -s $vg lvcreate --type snapshot -V50 -L1 -n $lv1 -s $vg

View File

@ -18,20 +18,20 @@ SKIP_WITH_LVMPOLLD=1
aux prepare_pvs aux prepare_pvs
get_devs get_devs
vgcreate -s 1k "$vg" "${DEVICES[@]}" vgcreate -s 4k "$vg" "${DEVICES[@]}"
# 3 Chunks # 3 Chunks
lvcreate -aey -n one -l 10 $vg lvcreate -aey -n one -l 10 $vg
lvcreate -s -l 12 -n snapA $vg/one lvcreate -s -l 3 -n snapA $vg/one
lvcreate -s -c 4k -l 12 -n snapX1 $vg/one lvcreate -s -c 4k -l 3 -n snapX1 $vg/one
lvcreate -s -c 8k -l 24 -n snapX2 $vg/one lvcreate -s -c 8k -l 6 -n snapX2 $vg/one
# Check that snapshots that are too small are caught with correct error. # Check that snapshots that are too small are caught with correct error.
not lvcreate -s -c 8k -l 8 -n snapX3 $vg/one 2>&1 | tee lvcreate.out not lvcreate -s -c 8k -l 2 -n snapX3 $vg/one 2>&1 | tee lvcreate.out
not grep "suspend origin one" lvcreate.out not grep "suspend origin one" lvcreate.out
grep "smaller" lvcreate.out grep "smaller" lvcreate.out
not lvcreate -s -l 4 -n snapB $vg/one 2>&1 | tee lvcreate.out not lvcreate -s -l 1 -n snapB $vg/one 2>&1 | tee lvcreate.out
not grep "suspend origin one" lvcreate.out not grep "suspend origin one" lvcreate.out
grep "smaller" lvcreate.out grep "smaller" lvcreate.out

View File

@ -21,7 +21,7 @@ SKIP_WITH_LVMPOLLD=1
aux prepare_pvs 1 aux prepare_pvs 1
get_devs get_devs
vgcreate -s 1K "$vg" "${DEVICES[@]}" vgcreate -s 4K "$vg" "${DEVICES[@]}"
lvcreate -aey -L1 -n $lv1 $vg lvcreate -aey -L1 -n $lv1 $vg
# Snapshot should be large enough to handle any writes # Snapshot should be large enough to handle any writes

View File

@ -27,7 +27,7 @@ fill() {
cleanup_tail() cleanup_tail()
{ {
test -z "$SLEEP_PID" || kill $SLEEP_PID || true test -z "${SLEEP_PID-}" || kill $SLEEP_PID || true
wait wait
vgremove -ff $vg1 || true vgremove -ff $vg1 || true
vgremove -ff $vg vgremove -ff $vg
@ -83,8 +83,7 @@ aux lvmconf "activation/snapshot_autoextend_percent = 20" \
# Check usability with smallest (1k) extent size ($lv has 15P) # Check usability with smallest (1k) extent size ($lv has 15P)
pvcreate --yes --setphysicalvolumesize 4T "$DM_DEV_DIR/$vg/$lv" pvcreate --yes --setphysicalvolumesize 4T "$DM_DEV_DIR/$vg/$lv"
trap 'cleanup_tail' EXIT trap 'cleanup_tail' EXIT
vgcreate -s 1K $vg1 "$DM_DEV_DIR/$vg/$lv" vgcreate -s 4K $vg1 "$DM_DEV_DIR/$vg/$lv"
# Play with small 1k 128 extents # Play with small 1k 128 extents
lvcreate -aey -L128K -n $lv $vg1 lvcreate -aey -L128K -n $lv $vg1
@ -135,29 +134,30 @@ check lv_not_exists $vg1 $lv1
# Check border size # Check border size
lvcreate -aey -L4095G $vg1 lvcreate -aey -L4095G $vg1
lvcreate -s -L100K $vg1/lvol0 lvcreate -s -L100K $vg1/lvol0
fill 1K fill 4K
check lv_field $vg1/lvol1 data_percent "12.00" check lv_field $vg1/lvol1 data_percent "12.00"
lvremove -ff $vg1 lvremove -ff $vg1
# Create 1KB snapshot, does not need to be active here # Create 4KB snapshot, does not need to be active here
lvcreate -an -Zn -l1 -n $lv1 $vg1 lvcreate -an -Zn -l1 -n $lv1 $vg1
not lvcreate -s -l1 $vg1/$lv1 not lvcreate -s -l1 $vg1/$lv1
not lvcreate -s -l3 $vg1/$lv1 # snapshot cannot be smaller then 3 chunks (12K)
not lvcreate -s -l2 $vg1/$lv1
lvcreate -s -l30 -n $lv2 $vg1/$lv1 lvcreate -s -l30 -n $lv2 $vg1/$lv1
check lv_field $vg1/$lv2 size "$EXPECT1" check lv_field $vg1/$lv2 size "$EXPECT1"
not lvcreate -s -c512 -l512 $vg1/$lv1 not lvcreate -s -c512 -l128 $vg1/$lv1
lvcreate -s -c128 -l1700 -n $lv3 $vg1/$lv1 lvcreate -s -c128 -l1700 -n $lv3 $vg1/$lv1
# 3 * 128 # 3 * 128
check lv_field $vg1/$lv3 size "$EXPECT2" check lv_field $vg1/$lv3 size "$EXPECT2"
lvremove -ff $vg1 lvremove -ff $vg1
lvcreate -aey -l20 $vg1 lvcreate -aey -l5 $vg1
lvcreate -s -l12 $vg1/lvol0 lvcreate -s -l3 $vg1/lvol0
# Fill 1KB -> 100% snapshot (1x 4KB chunk) # Fill 4KB -> 100% snapshot (1x 4KB chunk)
fill 1K fill 4K
check lv_field $vg1/lvol1 data_percent "100.00" check lv_field $vg1/lvol1 data_percent "100.00"
# Check it resizes 100% full valid snapshot to fit threshold # Check it resizes 100% full valid snapshot to fit threshold
@ -168,7 +168,7 @@ fill 4K
lvextend --use-policies $vg1/lvol1 lvextend --use-policies $vg1/lvol1
check lv_field $vg1/lvol1 size "24.00k" check lv_field $vg1/lvol1 size "24.00k"
lvextend -l+33 $vg1/lvol1 lvextend -l+8 $vg1/lvol1
check lv_field $vg1/lvol1 size "$EXPECT3" check lv_field $vg1/lvol1 size "$EXPECT3"
fill 20K fill 20K