def test_check_mon_pdb_post_upgrade(self): """ Testcase to check disruptions_allowed and minimum available, maximum unavailable mon count """ ceph_obj = CephCluster() # Check for mon count mons_after_upgrade = ceph_obj.get_mons_from_cluster() log.info(f"Mons after upgrade {mons_after_upgrade}") disruptions_allowed, min_available_mon, max_unavailable_mon = get_mon_pdb( ) log.info(f"Number of Mons Disruptions_allowed {disruptions_allowed}") log.info(f"Minimum_available mon count {min_available_mon}") log.info(f"Maximum_available mon count {max_unavailable_mon}") # The PDB values are considered from OCS 4.5 onwards. assert disruptions_allowed == 1, "Mon Disruptions_allowed count not matching" ocs_version = config.ENV_DATA["ocs_version"] if Version.coerce(ocs_version) < Version.coerce("4.6"): assert min_available_mon == 2, "Minimum available mon count is not matching" else: # This mon pdb change is from 4.6.5, 4.7 on wards, please refer bz1946573, bz1935065 # (https://bugzilla.redhat.com/show_bug.cgi?id=1946573) # (https://bugzilla.redhat.com/show_bug.cgi?id=1935065) assert (max_unavailable_mon == 1 ), "Maximum unavailable mon count is not matching"
def test_check_mon_pdb_post_upgrade(): """ Testcase to check disruptions_allowed and minimum available mon count """ ceph_obj = CephCluster() # Check for mon count mons_after_upgrade = ceph_obj.get_mons_from_cluster() log.info(f"Mons after upgrade {mons_after_upgrade}") disruptions_allowed, min_available_mon = get_mon_pdb() log.info(f"Number of Mons Disruptions_allowed {disruptions_allowed}") log.info(f"Minimum_available mon count {min_available_mon}") # The PDB values are considered from OCS 4.5 onwards. assert disruptions_allowed == 1, "Mon Disruptions_allowed count not matching" assert min_available_mon == 2, "Minimum available mon count is not matching"
def test_remove_mon_pod_from_cluster(self): """ To remove mon pod from the cluster after the I/O is performed on the pool and waiting for the operator to create a new mon pod on its own """ ceph_cluster = CephCluster() pods = ocp.OCP(kind=constants.POD, namespace=config.ENV_DATA['cluster_namespace']) list_mons = ceph_cluster.get_mons_from_cluster() assert len(list_mons) > 1, pytest.skip( "INVALID: Mon count should be more than one to delete.") self.pool_obj = create_ceph_block_pool() assert run_io_on_pool(self.pool_obj), 'Failed to run I/O on the pool' assert delete_cephblockpools([self.pool_obj]), 'Failed to delete pool' ceph_cluster.cluster_health_check(timeout=0) ceph_cluster.remove_mon_from_cluster() assert verify_mon_pod_up(pods), "Mon pods are not up and running state" ceph_cluster.cluster_health_check(timeout=60)