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)
# 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')