]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: Handle TypeError in test_filelock 68389/head
authorKarthik U S <karthik.u.s1@ibm.com>
Wed, 15 Apr 2026 15:17:45 +0000 (20:47 +0530)
committerKarthik U S <karthik.u.s1@ibm.com>
Wed, 22 Apr 2026 09:59:13 +0000 (15:29 +0530)
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 <karthik.u.s1@ibm.com>
qa/tasks/cephfs/test_client_recovery.py

index b5cd20cad97ac2573cc3dddb1c3a29ef2684e639..9ba2c1c4ae252cfca71e0fbcb9dd0e6d9a7ef87e 100644 (file)
@@ -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\.]+")