]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
test: don't worry too much about array size.
authorNeilBrown <neilb@suse.de>
Thu, 3 May 2012 05:29:04 +0000 (15:29 +1000)
committerNeilBrown <neilb@suse.de>
Thu, 3 May 2012 05:29:04 +0000 (15:29 +1000)
With different amounts of space being reserved for metadata
it is hard for the script to know how big the array should be.
So allow a bit of slack.

Signed-off-by: NeilBrown <neilb@suse.de>
test

diff --git a/test b/test
index 1aaf3c1c4a18bf2c5f99bc2ce3ab044cd970d088..2964b3bb834257065b1ec25d120068a0c67726f2 100755 (executable)
--- a/test
+++ b/test
@@ -190,9 +190,10 @@ testdev() {
       rasize=$[rasize*DEV_ROUND_K*2]
    fi
    if [ `/sbin/blockdev --getsize $dev` -eq 0 ]; then sleep 2 ; fi
-   if [ $rasize -ne `/sbin/blockdev --getsize $dev` ]
+   _sz=`/sbin/blockdev --getsize $dev`
+   if [ $rasize -lt $_sz -o $[rasize*4/5] -gt $_sz ]
    then
-     echo "ERROR: size is wrong for $dev: $cnt * $dvsize (chunk=$chunk) = $rasize, not `/sbin/blockdev --getsize $dev`"
+     echo "ERROR: size is wrong for $dev: $cnt * $dvsize (chunk=$chunk) = $rasize, not $_sz"
      exit 1
    fi
 }