From 7324086c3e30db6662e1ec7ff68acbf8d7d4e657 Mon Sep 17 00:00:00 2001 From: Kamoltat Date: Fri, 10 May 2024 15:51:38 +0000 Subject: [PATCH] qa/tasks/mgr/test_progress.py: deal with pre-exisiting pool 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 (cherry picked from commit b083552cea0f75e76849300a1352b71d2229c6a6) --- qa/tasks/mgr/test_progress.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/qa/tasks/mgr/test_progress.py b/qa/tasks/mgr/test_progress.py index a80600c6a80..948bb2da063 100644 --- a/qa/tasks/mgr/test_progress.py +++ b/qa/tasks/mgr/test_progress.py @@ -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') -- 2.47.3