1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

TEST: Fix 'dd' overrunning device size and causing test failure

Assumed size of 4M was too large and the test was failing because
'dd' was failing to perform its write.

Calculate the size we need to write with 'dd' instead, so we
don't overrun the device.
This commit is contained in:
Jonathan Brassow 2013-06-17 12:38:09 -05:00
parent 21f1062ef8
commit 7a4fdc1902

View File

@ -177,11 +177,16 @@ run_syncaction_check() {
# run_refresh_check <VG> <LV>
# Assumes "$dev2" is in the array
run_refresh_check() {
local size
aux wait_for_sync $1 $2
size=`lvs -a --noheadings -o size --units 1k $1/$2 | sed s/\.00k//`
size=$(sed s/^[[:space:]]*// <<< "$size")
# Disable dev2 and do some I/O to make the kernel notice
aux disable_dev "$dev2"
dd if=/dev/urandom of=/dev/$1/$2 bs=4M count=1
dd if=/dev/urandom of=/dev/$1/$2 bs=1k count=$size
# Check for 'p'artial flag
lvs --noheadings -o lv_attr $1/$2 | grep '.*p$'