]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: Add test for subvolumegroup ls filter
authorKotresh HR <khiremat@redhat.com>
Tue, 1 Feb 2022 11:08:41 +0000 (16:38 +0530)
committerKotresh HR <khiremat@redhat.com>
Wed, 16 Mar 2022 06:47:22 +0000 (12:17 +0530)
Fixes: https://tracker.ceph.com/issues/54099
Signed-off-by: Kotresh HR <khiremat@redhat.com>
(cherry picked from commit 95a83efcbe7b7faf2a292889e7c7ea7fcc629749)

qa/tasks/cephfs/test_volumes.py

index cfbcfcdf09fd2515ebff01e9d10415c54ea258f6..2f45fc01909b3d960db4caba5949dd2c53a4bf56 100644 (file)
@@ -683,6 +683,26 @@ class TestSubvolumeGroups(TestVolumesHelper):
             if collections.Counter(subvolgroupnames) != collections.Counter(subvolumegroups):
                 raise RuntimeError("Error creating or listing subvolume groups")
 
+    def test_subvolume_group_ls_filter(self):
+        # tests the 'fs subvolumegroup ls' command filters '_deleting' directory
+
+        subvolumegroups = []
+
+        #create subvolumegroup
+        subvolumegroups = self._generate_random_group_name(3)
+        for groupname in subvolumegroups:
+            self._fs_cmd("subvolumegroup", "create", self.volname, groupname)
+
+        # create subvolume and remove. This creates '_deleting' directory.
+        subvolume = self._generate_random_subvolume_name()
+        self._fs_cmd("subvolume", "create", self.volname, subvolume)
+        self._fs_cmd("subvolume", "rm", self.volname, subvolume)
+
+        subvolumegroupls = json.loads(self._fs_cmd('subvolumegroup', 'ls', self.volname))
+        subvolgroupnames = [subvolumegroup['name'] for subvolumegroup in subvolumegroupls]
+        if "_deleting" in subvolgroupnames:
+            self.fail("Listing subvolume groups listed '_deleting' directory")
+
     def test_subvolume_group_ls_for_nonexistent_volume(self):
         # tests the 'fs subvolumegroup ls' command when /volume doesn't exist
         # prerequisite: we expect that the test volume is created and a subvolumegroup is NOT created