From: Josh Durgin Date: Wed, 12 Nov 2014 02:16:02 +0000 (-0800) Subject: qa: allow small allocation diffs for exported rbds X-Git-Tag: v0.80.8~27 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0d8ad6ad3c376bcab981bea9a49e1924d7eddb68;p=ceph.git qa: allow small allocation diffs for exported rbds The local filesytem may behave slightly differently. This isn't foolproof, but seems to be reliable enough on rhel7 rootfs, where exact comparison was failing. Fixes: #10002 Signed-off-by: Josh Durgin (cherry picked from commit e94d3c11edb9c9cbcf108463fdff8404df79be33) --- diff --git a/qa/workunits/rbd/import_export.sh b/qa/workunits/rbd/import_export.sh index b8fa0f781fc39..d1ba29a4f1ece 100755 --- a/qa/workunits/rbd/import_export.sh +++ b/qa/workunits/rbd/import_export.sh @@ -20,7 +20,9 @@ compare_files_and_ondisk_sizes () { cmp -l $1 $2 || return 1 origsize=$(stat $1 --format %b) exportsize=$(stat $2 --format %b) - [ $origsize = $exportsize ] + difference=$(($exportsize - $origsize)) + difference=${difference#-} # absolute value + test $difference -ge 0 -a $difference -lt 4096 } # cannot import a dir