From 691352413e2b8ada25b587c1287a47087c3b9385 Mon Sep 17 00:00:00 2001 From: Jos Collin Date: Tue, 26 Nov 2019 17:54:30 +0530 Subject: [PATCH] qa/tasks: Fix the volume ls in test_volume_rm Signed-off-by: Jos Collin --- qa/tasks/cephfs/test_volumes.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/qa/tasks/cephfs/test_volumes.py b/qa/tasks/cephfs/test_volumes.py index 8b3e7498e261..f635ea8b83dc 100644 --- a/qa/tasks/cephfs/test_volumes.py +++ b/qa/tasks/cephfs/test_volumes.py @@ -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.") -- 2.47.3