From 7a4fdc19022e578c6003b6bdbd9e5edfa753a827 Mon Sep 17 00:00:00 2001 From: Jonathan Brassow Date: Mon, 17 Jun 2013 12:38:09 -0500 Subject: [PATCH] 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. --- test/shell/lvchange-raid.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/shell/lvchange-raid.sh b/test/shell/lvchange-raid.sh index b331961a8..da9c76eb0 100644 --- a/test/shell/lvchange-raid.sh +++ b/test/shell/lvchange-raid.sh @@ -177,11 +177,16 @@ run_syncaction_check() { # run_refresh_check # 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$'