Skip to content

Commit b083552

Browse files
committed
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 <[email protected]>
1 parent 61bf8cb commit b083552

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

qa/tasks/mgr/test_progress.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,15 @@ def setUp(self):
174174

175175
# Remove all other pools
176176
for pool in self.mgr_cluster.mon_manager.get_osd_dump_json()['pools']:
177-
self.mgr_cluster.mon_manager.remove_pool(pool['pool_name'])
177+
# There might be some pools that wasn't created with this test.
178+
# So we would use a raw cluster command to remove them.
179+
pool_name = pool['pool_name']
180+
if pool_name in self.mgr_cluster.mon_manager.pools:
181+
self.mgr_cluster.mon_manager.remove_pool(pool_name)
182+
else:
183+
self.mgr_cluster.mon_manager.raw_cluster_cmd(
184+
'osd', 'pool', 'rm', pool_name, pool_name,
185+
"--yes-i-really-really-mean-it")
178186

179187
self._load_module("progress")
180188
self.mgr_cluster.mon_manager.raw_cluster_cmd('progress', 'clear')

0 commit comments

Comments
 (0)