From: Rishabh Dave Date: Thu, 3 Apr 2025 18:43:55 +0000 (+0530) Subject: qa/cephfs: test that group name is included in pool namespace name X-Git-Tag: testing/wip-vshankar-testing-20250721.082855-tentacle-debug^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0db74b84df81fcb196c926659225eb6fcff93637;p=ceph-ci.git qa/cephfs: test that group name is included in pool namespace name Test that subvolume group name is included in the string that serves as the name of pool namespace for a subvolume. IOW, that serves as value of the extended attribute "ceph.dir.layout.pool_namespace" for a subvolume. Signed-off-by: Rishabh Dave (cherry picked from commit db8c3f99f97c3a8a332275ddee97d8303406e663) --- diff --git a/qa/tasks/cephfs/test_volumes.py b/qa/tasks/cephfs/test_volumes.py index 26dd8332349..8986af87390 100644 --- a/qa/tasks/cephfs/test_volumes.py +++ b/qa/tasks/cephfs/test_volumes.py @@ -2341,7 +2341,8 @@ class TestSubvolumes(TestVolumesHelper): # get subvolume metadata subvol_info = json.loads(self._get_subvolume_info(self.volname, subvolume)) self.assertNotEqual(len(subvol_info), 0) - self.assertEqual(subvol_info["pool_namespace"], "fsvolumens_" + subvolume) + pool_namespace = subvol_info["pool_namespace"] + self.assertEqual(pool_namespace, f'fsvolumens___nogroup_{subvolume}') # remove subvolumes self._fs_cmd("subvolume", "rm", self.volname, subvolume) @@ -2349,6 +2350,26 @@ class TestSubvolumes(TestVolumesHelper): # verify trash dir is clean self._wait_for_trash_empty() + def test_for_group_name_in_pool_namespace(self): + ''' + Test that subvolume group name is included in the pool namespace of a + subvolume. + ''' + sv = self._gen_subvol_name() + svg = self._gen_subvol_grp_name() + self.run_ceph_cmd(f'fs subvolumegroup create {self.volname} {svg}') + self.run_ceph_cmd(f'fs subvolume create {self.volname} {sv} {svg} ' + f'--namespace-isolated') + + subvol_info = self._get_subvolume_info(self.volname, sv, svg) + subvol_info = json.loads(subvol_info) + pool_namespace = subvol_info['pool_namespace'] + self.assertEqual(pool_namespace, f'fsvolumens__{svg}_{sv}') + + self.run_ceph_cmd(f'fs subvolume rm {self.volname} {sv} {svg}') + self.run_ceph_cmd(f'fs subvolumegroup rm {self.volname} {svg}') + self._wait_for_trash_empty() + def test_subvolume_create_with_auto_cleanup_on_fail(self): subvolume = self._gen_subvol_name() data_pool = "invalid_pool"