]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: Fix checksum calculation on empty directories 68128/head
authorKotresh HR <khiremat@redhat.com>
Mon, 6 Apr 2026 07:38:03 +0000 (13:08 +0530)
committerKotresh HR <khiremat@redhat.com>
Sat, 18 Apr 2026 12:47:04 +0000 (18:17 +0530)
Fixes: https://tracker.ceph.com/issues/75804
Signed-off-by: Kotresh HR <khiremat@redhat.com>
qa/tasks/cephfs/mount.py

index 47b12be2387ab0b233741022e337600fd9d8573b..26b848b477ad34bffafe8fa95dff98248971ec32 100644 (file)
@@ -1826,6 +1826,9 @@ class CephFSMountBase(object):
             cmd.append(path)
         cmd.extend(["-type", "f", "-exec", "md5sum", "{}", "+"])
         checksum_text = self.run_shell(cmd).stdout.getvalue().strip()
+        # Handle empty directory
+        if not checksum_text:
+          return hashlib.md5(b'').hexdigest()
         checksum_sorted = sorted(checksum_text.split('\n'), key=lambda v: v.split()[1])
         return hashlib.md5(('\n'.join(checksum_sorted)).encode('utf-8')).hexdigest()