]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/mgr/test_progress.py: deal with pre-exisiting pool 58263/head
authorKamoltat <ksirivad@redhat.com>
Fri, 10 May 2024 15:51:38 +0000 (15:51 +0000)
committerAishwarya Mathuria <amathuri@redhat.com>
Tue, 25 Jun 2024 14:46:28 +0000 (20:16 +0530)
Problem:
Currently, the test will fail we try
to remove a pool that was not created
by test_progress.py if we use the function
`remove_pool` from class CephManager
because it tracks the pools in a dictionary
and there is an assert to check if the pool
exists in the dictionary.

Solution:
Therefore, add a case where if
there is a pool that was not created
by the test, then we would delete it
through raw command instead of using
`remove_pool` from CephManager

Fixes: https://tracker.ceph.com/issues/65826
Signed-off-by: Kamoltat <ksirivad@redhat.com>
(cherry picked from commit b083552cea0f75e76849300a1352b71d2229c6a6)

qa/tasks/mgr/test_progress.py

index a80600c6a803587ef4cc758ec7108b0dd8f768f8..948bb2da063aaa9fd7ddd2ff577bbbe927f19717 100644 (file)
@@ -174,7 +174,15 @@ class TestProgress(MgrTestCase):
 
         # Remove all other pools
         for pool in self.mgr_cluster.mon_manager.get_osd_dump_json()['pools']:
-            self.mgr_cluster.mon_manager.remove_pool(pool['pool_name'])
+            # There might be some pools that wasn't created with this test.
+            # So we would use a raw cluster command to remove them.
+            pool_name = pool['pool_name']
+            if pool_name in self.mgr_cluster.mon_manager.pools:
+                self.mgr_cluster.mon_manager.remove_pool(pool_name)
+            else:
+                self.mgr_cluster.mon_manager.raw_cluster_cmd(
+                    'osd', 'pool', 'rm', pool_name, pool_name,
+                    "--yes-i-really-really-mean-it")
 
         self._load_module("progress")
         self.mgr_cluster.mon_manager.raw_cluster_cmd('progress', 'clear')