1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-23 21:35:29 +03:00

tests: fix ra checking

Since with some installed package like 'tuned' the value of 'RA' on
PV origin device can be different, adapting tests to count with this.
This commit is contained in:
Zdenek Kabelac 2019-06-18 13:20:27 +02:00
parent e80ca65d30
commit 29ae8b8ca5
2 changed files with 15 additions and 5 deletions

View File

@ -175,15 +175,21 @@ check lv_field $vg/$lv2 lv_kernel_read_ahead "0"
lvcreate -L 8 -n $lv3 --readahead 8k $vg
check lv_field $vg/$lv3 lv_read_ahead "8.00k"
check lv_field $vg/$lv3 lv_kernel_read_ahead "8.00k"
lvcreate -L 8 -n $lv4 --readahead auto $vg
lvcreate -L 8 -n $lv4 --readahead auto $vg "$dev1"
check lv_field $vg/$lv4 lv_read_ahead "auto"
check lv_field $vg/$lv4 lv_kernel_read_ahead "128.00k"
# figure RA value of a PV origin device
DEVICE=$(dmsetup deps -o blkdevname "$dev1" | sed -e "s,.*:\ (\(.*\)),/dev/\1,")
RASZ=$(( $(blockdev --getra "$DEVICE" ) / 2 ))
SZ="$RASZ.00k"
test "$RASZ" -ge 128 || SZ="128.00k"
check lv_field $vg/$lv4 lv_kernel_read_ahead "$SZ" --units k
lvcreate -L 8 -n $lv5 -i2 --stripesize 16k --readahead auto $vg
check lv_field $vg/$lv5 lv_read_ahead "auto"
check lv_field $vg/$lv5 lv_kernel_read_ahead "128.00k"
check lv_field $vg/$lv5 lv_kernel_read_ahead "$SZ" --units k
lvcreate -L 8 -n $lv6 -i2 --stripesize 128k --readahead auto $vg
check lv_field $vg/$lv6 lv_read_ahead "auto"
check lv_field $vg/$lv6 lv_kernel_read_ahead "512.00k"
test "$RASZ" -ge 512 || SZ="512.00k"
check lv_field $vg/$lv6 lv_kernel_read_ahead "$SZ" --units k
lvremove -ff $vg
#

View File

@ -35,8 +35,12 @@ lvremove -ff $vg
#COMM "read ahead is properly inherited from underlying PV"
blockdev --setra 768 "$dev1"
vgscan
DEVICE=$(dmsetup deps -o blkdevname "$dev1" | sed -e "s,.*:\ (\(.*\)),/dev/\1,")
RASZ=$(blockdev --getra "$DEVICE")
SZ=$RASZ
test "$RASZ" -ge 768 || SZ=768
lvcreate -n $lv -L4m $vg "$dev1"
test "$(blockdev --getra "$DM_DEV_DIR/$vg/$lv")" -eq 768
test "$(blockdev --getra "$DM_DEV_DIR/$vg/$lv")" -eq "$SZ"
lvremove -ff $vg
# Check default, active/inactive values for read_ahead / kernel_read_ahead