Skip to content

Commit a9ad5dd

Browse files
authored
Merge pull request ceph#63381 from mkogan1/wip-d3n-test-stripe_size
rgw/d3n: fix teuthology run-datacache.sh FAIL when stripe_size!=4MiB
2 parents e91b06a + 16ad813 commit a9ad5dd

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

qa/workunits/rgw/test_rgw_datacache.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,14 @@ def main():
198198

199199
out = exec_cmd("dd status=none if=%s of=/dev/stdout bs=1M skip=4 | sha1sum | awk '{ print $1 }'" % (outfile))
200200
org_object_sha1 = get_cmd_output(out)
201-
log.debug("SHA1 of original file is: %s", org_object_sha1)
202-
203-
assert(cached_object_sha1 == org_object_sha1) # Datacache test failed if sha1 of cached object does not match original object sha1"
201+
log.debug("SHA1 of cached part in original file is: %s", org_object_sha1)
202+
out = exec_cmd("dd status=none if=%s of=/dev/stdout bs=1M skip=4 | sha1sum | awk '{ print $1 }'" % (get_file_path))
203+
download_object_sha1 = get_cmd_output(out)
204+
log.debug("SHA1 of cached part in downloaded file is: %s", download_object_sha1)
205+
206+
assert((cached_object_sha1 == org_object_sha1) or (org_object_sha1 == download_object_sha1 and chk_cache_dir > 0))
207+
# (cached_object_sha1 == org_object_sha1) test fails if "stripe_size" is not exactly 4MiB(4194304),
208+
# in that case fall back to checking the sha1 of the downloaded file
204209
log.debug("RGW Datacache test SUCCESS")
205210

206211
# remove datacache dir

0 commit comments

Comments
 (0)