]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: allow small allocation diffs for exported rbds 2899/head
authorJosh Durgin <jdurgin@redhat.com>
Wed, 12 Nov 2014 02:16:02 +0000 (18:16 -0800)
committerJosh Durgin <jdurgin@redhat.com>
Wed, 12 Nov 2014 02:16:04 +0000 (18:16 -0800)
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 <jdurgin@redhat.com>
qa/workunits/rbd/import_export.sh

index b8fa0f781fc3980357af5578ba466ac77d83f58c..d1ba29a4f1ece4e8bcaf367072e1b313020f7a8a 100755 (executable)
@@ -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