From: Josh Durgin Date: Wed, 12 Nov 2014 02:16:02 +0000 (-0800) Subject: qa: allow small allocation diffs for exported rbds X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e17d579f9cc35393b7f1f6626f6732430bc4a2f6;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 8566d18e48e..284e1f34363 100755 --- a/qa/workunits/rbd/import_export.sh +++ b/qa/workunits/rbd/import_export.sh @@ -19,7 +19,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