]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/d3n: fix teuthology run-datacache.sh FAIL when stripe_size!=4MiB 63381/head
authorMark Kogan <mkogan@redhat.com>
Tue, 20 May 2025 11:49:19 +0000 (11:49 +0000)
committerMark Kogan <mkogan@redhat.com>
Sun, 25 May 2025 07:33:25 +0000 (07:33 +0000)
Fixes: https://tracker.ceph.com/issues/71387
Signed-off-by: Mark Kogan <mkogan@redhat.com>
qa/workunits/rgw/test_rgw_datacache.py

index 426524ae8742df00bfb505a3065cda7289c01b3c..95e3b9fdd4458a0b307f89c361cdb7508f3446ad 100755 (executable)
@@ -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