From: Karthik U S Date: Wed, 15 Apr 2026 15:17:45 +0000 (+0530) Subject: qa: Handle TypeError in test_filelock X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1c70ef1c6a284a974cdeb0ddaba19be90d3e6c91;p=ceph.git qa: Handle TypeError in test_filelock Latest versions of OS comes with fuse3 installed and we are checking for only fuse in the get_package_version check in the test case. Checking just for the package string fuse will return None if only fuse3 is installed. Adding check for both fuse and fuse3 packages now and also handling NoneType return in _is_flockable() if the package is actually missing. Fixes: https://tracker.ceph.com/issues/75959 Signed-off-by: Karthik U S --- diff --git a/qa/tasks/cephfs/test_client_recovery.py b/qa/tasks/cephfs/test_client_recovery.py index b5cd20cad97a..9ba2c1c4ae25 100644 --- a/qa/tasks/cephfs/test_client_recovery.py +++ b/qa/tasks/cephfs/test_client_recovery.py @@ -349,9 +349,23 @@ class TestClientRecovery(CephFSTestCase): count, num_caps )) + def _fuse_package_version(self, client_remote): + for pkg in ("fuse", "fuse3"): + ver = get_package_version(client_remote, pkg) + if ver: + log.debug(f'using {pkg} package version {ver} for flock check') + return ver + return None + def _is_flockable(self): - a_version_str = get_package_version(self.mount_a.client_remote, "fuse") - b_version_str = get_package_version(self.mount_b.client_remote, "fuse") + a_version_str = self._fuse_package_version(self.mount_a.client_remote) + b_version_str = self._fuse_package_version(self.mount_b.client_remote) + + if (a_version_str is None or b_version_str is None): + log.info("not testing flock locks, could not determine fuse version(s) {av} and {bv}".format( + av=a_version_str, bv=b_version_str)) + return False + flock_version_str = "2.9" version_regex = re.compile(r"[0-9\.]+")