From 3ea2d45239b5b4d6d4c28e5f1b93beff8dc26b0c Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Mon, 6 Apr 2026 13:08:03 +0530 Subject: [PATCH] qa: Fix checksum calculation on empty directories Fixes: https://tracker.ceph.com/issues/75804 Signed-off-by: Kotresh HR --- qa/tasks/cephfs/mount.py | 3 +++ 1 file changed, 3 insertions(+) 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() -- 2.47.3