From: Kotresh HR Date: Mon, 6 Apr 2026 07:38:03 +0000 (+0530) Subject: qa: Fix checksum calculation on empty directories X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3ea2d45239b5b4d6d4c28e5f1b93beff8dc26b0c;p=ceph.git qa: Fix checksum calculation on empty directories Fixes: https://tracker.ceph.com/issues/75804 Signed-off-by: Kotresh HR --- diff --git a/qa/tasks/cephfs/mount.py b/qa/tasks/cephfs/mount.py index 47b12be2387a..26b848b477ad 100644 --- a/qa/tasks/cephfs/mount.py +++ b/qa/tasks/cephfs/mount.py @@ -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()