# 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")