]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: test alternate_name recovery during mds failover
authorPatrick Donnelly <pdonnell@ibm.com>
Tue, 11 Mar 2025 19:18:03 +0000 (15:18 -0400)
committerPatrick Donnelly <pdonnell@ibm.com>
Thu, 13 Mar 2025 14:08:19 +0000 (10:08 -0400)
Fixes: https://tracker.ceph.com/issues/70409
Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
qa/tasks/cephfs/test_dir_charmap.py

index e4b52bc1f6cf018fdb0131f017b4b81684e85422..d32b487ceb6664ca95cf946b064fcbc9bde27840 100644 (file)
@@ -269,6 +269,51 @@ class TestCharMapVxattr(CephFSTestCase, CharMapMixin):
             else:
                 self.fail("should fail")
 
+
+class TestCharMapRecovery(CephFSTestCase, CharMapMixin):
+    CLIENTS_REQUIRED = 1
+    MDSS_REQUIRED = 1
+
+    def test_primary_altname_recovery(self):
+        """
+        That the MDS can recovery the alternate_name from the primary link
+        encoded in the fullbit.
+        """
+
+        dname = "Grüßen"
+        self.mount_a.run_shell_payload("mkdir foo/")
+        self.mount_a.setfattr("foo/", "ceph.dir.casesensitive", "0")
+        self.mount_a.run_shell_payload(f"dd if=/dev/urandom of=foo/{dname} conv=fsync bs=1 count=1")
+        self.mount_a.umount_wait()
+
+        self.fs.fail()
+        self.fs.set_joinable()
+        self.fs.wait_for_daemons()
+
+        self.mount_a.mount()
+        self.mount_a.run_shell_payload("ls -l foo")
+
+    def test_remote_altname_recovery(self):
+        """
+        That the MDS can recovery the alternate_name from the remote link
+        encoded in the fullbit.
+        """
+
+        dname = "Grüßen"
+        self.mount_a.run_shell_payload("mkdir foo/")
+        self.mount_a.setfattr("foo/", "ceph.dir.casesensitive", "0")
+        self.mount_a.run_shell_payload("dd if=/dev/urandom of=foo/file conv=fsync bs=1 count=1")
+        self.mount_a.run_shell_payload(f"ln -T foo/file foo/{dname}")
+        self.mount_a.umount_wait()
+
+        self.fs.fail()
+        self.fs.set_joinable()
+        self.fs.wait_for_daemons()
+
+        self.mount_a.mount()
+        self.mount_a.run_shell_payload("ls -l foo")
+
+
 class TestNormalization(CephFSTestCase, CharMapMixin):
     """
     Test charmap normalization.