From: Rishabh Dave Date: Fri, 7 Feb 2025 13:13:37 +0000 (+0530) Subject: qa/cephfs: add tests for "fs subvolume create" command when... X-Git-Tag: testing/wip-vshankar-testing-20250228.110804-debug~5^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=01f8f710c1a615bc9de03babc6d1fe7e0bc8a5bd;p=ceph-ci.git qa/cephfs: add tests for "fs subvolume create" command when... subvolume metadata file name length is too long. Signed-off-by: Rishabh Dave --- diff --git a/qa/tasks/cephfs/test_volumes.py b/qa/tasks/cephfs/test_volumes.py index 2ee3b6ac052..f69f370ec08 100644 --- a/qa/tasks/cephfs/test_volumes.py +++ b/qa/tasks/cephfs/test_volumes.py @@ -4345,6 +4345,36 @@ class TestSubvolumes(TestVolumesHelper): # verify trash dir is clean. self._wait_for_trash_empty() + def test_create_when_subvol_name_is_too_long(self): + ''' + 255 chars of subvol name + 7 chars of (':', '_' and '.meta') and 0 + chars for default group name is greater than 256 chars, therefore + subvol meta file issue should be tested. + ''' + subvolname = 's' * 255 + self.negtest_ceph_cmd( + f'fs subvolume create {self.volname} {subvolname}', + retval=errno.ENAMETOOLONG, + errmsgs='Error ENAMETOOLONG: use shorter group or subvol name, ' + 'combination of both should be less than 249 characters') + + def test_create_when_subvol_group_name_is_too_long(self): + ''' + 248 chars of group name + 7 chars of (':', '_' and '.meta') and 7 + chars for subvol name is greater than 256 chars, therefore subvol + meta file issue should be tested. + ''' + groupname = 'g' * 248 + self.run_ceph_cmd( + f'fs subvolumegroup create {self.volname} {groupname}') + subvolname = 's' * 7 + self.negtest_ceph_cmd( + f'fs subvolume create {self.volname} {subvolname} --group-name ' + f'{groupname}', + retval=errno.ENAMETOOLONG, + errmsgs='Error ENAMETOOLONG: use shorter group or subvol name, ' + 'combination of both should be less than 249 characters') + class TestSubvolumeGroupSnapshots(TestVolumesHelper): """Tests for FS subvolume group snapshot operations.""" @unittest.skip("skipping subvolumegroup snapshot tests")