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.89~15^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F2899%2Fhead;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 --- diff --git a/qa/workunits/rbd/import_export.sh b/qa/workunits/rbd/import_export.sh index b8fa0f781fc3..d1ba29a4f1ec 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