From 16ad8131f091f305277cc77478b6484aac4eb2ad Mon Sep 17 00:00:00 2001 From: Mark Kogan Date: Tue, 20 May 2025 11:49:19 +0000 Subject: [PATCH] rgw/d3n: fix teuthology run-datacache.sh FAIL when stripe_size!=4MiB Fixes: https://tracker.ceph.com/issues/71387 Signed-off-by: Mark Kogan --- qa/workunits/rgw/test_rgw_datacache.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/qa/workunits/rgw/test_rgw_datacache.py b/qa/workunits/rgw/test_rgw_datacache.py index 426524ae8742d..95e3b9fdd4458 100755 --- a/qa/workunits/rgw/test_rgw_datacache.py +++ b/qa/workunits/rgw/test_rgw_datacache.py @@ -198,9 +198,14 @@ def main(): out = exec_cmd("dd status=none if=%s of=/dev/stdout bs=1M skip=4 | sha1sum | awk '{ print $1 }'" % (outfile)) org_object_sha1 = get_cmd_output(out) - log.debug("SHA1 of original file is: %s", org_object_sha1) - - assert(cached_object_sha1 == org_object_sha1) # Datacache test failed if sha1 of cached object does not match original object sha1" + log.debug("SHA1 of cached part in original file is: %s", org_object_sha1) + out = exec_cmd("dd status=none if=%s of=/dev/stdout bs=1M skip=4 | sha1sum | awk '{ print $1 }'" % (get_file_path)) + download_object_sha1 = get_cmd_output(out) + log.debug("SHA1 of cached part in downloaded file is: %s", download_object_sha1) + + assert((cached_object_sha1 == org_object_sha1) or (org_object_sha1 == download_object_sha1 and chk_cache_dir > 0)) + # (cached_object_sha1 == org_object_sha1) test fails if "stripe_size" is not exactly 4MiB(4194304), + # in that case fall back to checking the sha1 of the downloaded file log.debug("RGW Datacache test SUCCESS") # remove datacache dir -- 2.39.5