]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
nautilus: qa/test_volumes: Modify tests not to use json for 'ceph fs status' 36167/head
authorKotresh HR <khiremat@redhat.com>
Mon, 27 Jul 2020 10:57:18 +0000 (16:27 +0530)
committerRamana Raja <rraja@redhat.com>
Mon, 27 Jul 2020 12:37:54 +0000 (18:07 +0530)
Signed-off-by: Kotresh HR <khiremat@redhat.com>
qa/tasks/cephfs/test_volumes.py

index a8c42c34a7455c7ceef57742ac535fbcbd173099..7679d5274b69d76340924022b6c27f83d3619d2c 100644 (file)
@@ -322,7 +322,6 @@ class TestVolumes(CephFSTestCase):
         new_pool = "new_pool"
         # add arbitrary data pool
         self.fs.add_data_pool(new_pool)
-        vol_status = json.loads(self._fs_cmd("status", self.volname, "--format=json-pretty"))
         self._fs_cmd("volume", "rm", self.volname, "--yes-i-really-mean-it")
 
         #check if fs is gone
@@ -331,9 +330,9 @@ class TestVolumes(CephFSTestCase):
         self.assertNotIn(self.volname, volnames)
 
         #check if osd pools are gone
-        pools = json.loads(self._raw_cmd("osd", "pool", "ls", "--format=json-pretty"))
-        for pool in vol_status["pools"]:
-            self.assertNotIn(pool["name"], pools)
+        pools = json.loads(self._raw_cmd("osd", "pool", "ls", "detail", "--format=json-pretty"))
+        for pool in pools:
+            self.assertNotIn(self.volname, pool["application_metadata"].keys())
 
     def test_volume_rm_when_mon_delete_pool_false(self):
         """
@@ -347,7 +346,6 @@ class TestVolumes(CephFSTestCase):
             self.assertEqual(ce.exitstatus, errno.EPERM,
                              "expected the 'fs volume rm' command to fail with EPERM, "
                              "but it failed with {0}".format(ce.exitstatus))
-        vol_status = json.loads(self._fs_cmd("status", self.volname, "--format=json-pretty"))
         self.config_set('mon', 'mon_allow_pool_delete', True)
         self._fs_cmd("volume", "rm", self.volname, "--yes-i-really-mean-it")
 
@@ -357,10 +355,10 @@ class TestVolumes(CephFSTestCase):
         self.assertNotIn(self.volname, volnames,
                          "volume {0} exists after removal".format(self.volname))
         #check if pools are gone
-        pools = json.loads(self._raw_cmd("osd", "pool", "ls", "--format=json-pretty"))
-        for pool in vol_status["pools"]:
-            self.assertNotIn(pool["name"], pools,
-                             "pool {0} exists after volume removal".format(pool["name"]))
+        pools = json.loads(self._raw_cmd("osd", "pool", "ls", "detail", "--format=json-pretty"))
+        for pool in pools:
+            self.assertNotIn(self.volname, pool["application_metadata"].keys(),
+                             "pool {0} exists after volume removal".format(pool["pool_name"]))
 
     ### basic subvolume operations