From: Xavi Hernandez Date: Wed, 19 Mar 2025 12:08:43 +0000 (+0100) Subject: qa: add tests for case sensitivity configuration on subvolume creation X-Git-Tag: v20.3.0~246^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=b8a77642ceb8ccd633e8f7d0efce9f6d15fd7365;p=ceph.git qa: add tests for case sensitivity configuration on subvolume creation Signed-off-by: Xavi Hernandez --- diff --git a/qa/tasks/cephfs/test_volumes.py b/qa/tasks/cephfs/test_volumes.py index e79c0ee802666..489bf4b6f530f 100644 --- a/qa/tasks/cephfs/test_volumes.py +++ b/qa/tasks/cephfs/test_volumes.py @@ -2716,6 +2716,40 @@ class TestSubvolumes(TestVolumesHelper): normalization = self._fs_cmd("subvolume", "charmap", "get", self.volname, subvolume, "normalization") self.assertEqual(normalization.strip(), "nfc") + def test_subvolume_create_without_case_sensitivity(self): + # create subvolume + subvolume = self._gen_subvol_name() + self._fs_cmd("subvolume", "create", self.volname, subvolume) + + # make sure it exists + subvolpath = self._get_subvolume_path(self.volname, subvolume) + self.assertNotEqual(subvolpath, None) + + # check case sensitivity + try: + self._fs_cmd("subvolume", "charmap", "get", self.volname, subvolume, "casesensitive") + except CommandFailedError as ce: + self.assertEqual(ce.exitstatus, errno.ENODATA) + else: + self.fail("expected the 'fs subvolume charmap' command to fail") + + def test_subvolume_create_with_case_insensitive(self): + # create subvolume + subvolume = self._gen_subvol_name() + self._fs_cmd("subvolume", "create", self.volname, subvolume, "--case-insensitive") + + # make sure it exists + subvolpath = self._get_subvolume_path(self.volname, subvolume) + self.assertNotEqual(subvolpath, None) + + # check case sensitivity + case_sensitive = self._fs_cmd("subvolume", "charmap", "get", self.volname, subvolume, "casesensitive") + self.assertEqual(case_sensitive.strip(), "0") + + # check normalization (it's implicitly enabled by --case-insensitive, with default value 'nfd') + normalization = self._fs_cmd("subvolume", "charmap", "get", self.volname, subvolume, "normalization") + self.assertEqual(normalization.strip(), "nfd") + def test_subvolume_expand(self): """ That a subvolume can be expanded in size and its quota matches the expected size.