From 0d8ad6ad3c376bcab981bea9a49e1924d7eddb68 Mon Sep 17 00:00:00 2001 From: Josh Durgin Date: Tue, 11 Nov 2014 18:16:02 -0800 Subject: [PATCH] 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) --- qa/workunits/rbd/import_export.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.39.5