]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: test for child dir with first beyond parent snaps
authorPatrick Donnelly <pdonnell@ibm.com>
Tue, 27 May 2025 14:03:12 +0000 (10:03 -0400)
committerPatrick Donnelly <pdonnell@ibm.com>
Tue, 27 May 2025 14:51:04 +0000 (10:51 -0400)
If the parent directory has snapshots but the child was created after, then we
should be able to modify its charmap.

Signed-off-by: Patrick Donnelly <pdonnell@ibm.com>
Fixes: https://tracker.ceph.com/issues/71462
qa/tasks/cephfs/test_dir_charmap.py

index 06e6c4efc9acd4ef4517e351bee0ed0de1ffc254..5b82753b365c018e82de2b777aa5d856e0d53be0 100644 (file)
@@ -280,6 +280,28 @@ class TestCharMapVxattr(CephFSTestCase, CharMapMixin):
             else:
                 self.fail("should fail")
 
+    def test_cs_no_parent_snaps_set_insensitive(self):
+        """
+        That setting a charmap succeeds for an empty directory with first beyond parent snaps.
+        """
+
+        attrs = {
+          "ceph.dir.casesensitive": False,
+          "ceph.dir.normalization": "nfc",
+          "ceph.dir.encoding": "utf8",
+        }
+
+        self.mount_a.run_shell_payload("mkdir -p foo/bar; mkdir foo/.snap/one; rmdir foo/bar; mkdir foo/bar")
+        for attr, v in attrs.items():
+            try:
+                self.mount_a.setfattr("foo/bar", attr, v, helpfulexception=True)
+            except DirectoryNotEmptyError:
+                self.fail("should not fail")
+        try:
+            self.check_cs("foo/bar", casesensitive=False, normalization="nfc")
+        except DirectoryNotEmptyError:
+            self.fail("should not fail")
+
     def test_cs_remount(self):
         """
         That a remount continues to see the charmap.