]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks: Fix the volume ls in test_volume_rm
authorJos Collin <jcollin@redhat.com>
Tue, 26 Nov 2019 12:24:30 +0000 (17:54 +0530)
committerRamana Raja <rraja@redhat.com>
Wed, 12 Feb 2020 10:11:59 +0000 (05:11 -0500)
Signed-off-by: Jos Collin <jcollin@redhat.com>
(cherry picked from commit 691352413e2b8ada25b587c1287a47087c3b9385)

qa/tasks/cephfs/test_volumes.py

index 51365c56120f4abe6bf319c2306e1b170d817fba..ed053ada2c16e72be82f12982123dc0fea50e6eb 100644 (file)
@@ -165,6 +165,10 @@ class TestVolumes(CephFSTestCase):
                 self._fs_cmd("volume", "rm", volume, "--yes-i-really-mean-it")
 
     def test_volume_rm(self):
+        """
+        That the volume can only be removed when --yes-i-really-mean-it is used
+        and verify that the deleted volume is not listed anymore.
+        """
         try:
             self._fs_cmd("volume", "rm", self.volname)
         except CommandFailedError as ce:
@@ -175,9 +179,10 @@ class TestVolumes(CephFSTestCase):
                 self._fs_cmd("volume", "rm", self.volname, "--yes-i-really-mean-it")
 
                 #check if it's gone
-                volumes = json.loads(self.mgr_cluster.mon_manager.raw_cluster_cmd('fs', 'volume', 'ls', '--format=json-pretty'))
+                volumes = json.loads(self._fs_cmd("volume", "ls", "--format=json-pretty"))
                 if (self.volname in [volume['name'] for volume in volumes]):
-                    raise RuntimeError("Expected the 'fs volume rm' command to succeed. The volume {0} not removed.".format(self.volname))
+                    raise RuntimeError("Expected the 'fs volume rm' command to succeed. "
+                                       "The volume {0} not removed.".format(self.volname))
         else:
             raise RuntimeError("expected the 'fs volume rm' command to fail.")