diff --git a/ocs_ci/helpers/sanity_helpers.py b/ocs_ci/helpers/sanity_helpers.py index 3e81032be53..e00ee2b17c9 100644 --- a/ocs_ci/helpers/sanity_helpers.py +++ b/ocs_ci/helpers/sanity_helpers.py @@ -65,7 +65,13 @@ def health_check(self, cluster_check=True, tries=20): self.ceph_cluster.cluster_health_check(timeout=120) def create_resources( - self, pvc_factory, pod_factory, bucket_factory, rgw_bucket_factory, run_io=True + self, + pvc_factory, + pod_factory, + bucket_factory, + rgw_bucket_factory, + run_io=True, + bucket_creation_timeout=180, ): """ Sanity validation: Create resources - pods, OBCs (RGW and MCG), PVCs (FS and RBD) and run IO @@ -76,6 +82,7 @@ def create_resources( bucket_factory (function): A call to bucket_factory function rgw_bucket_factory (function): A call to rgw_bucket_factory function run_io (bool): True for run IO, False otherwise + bucket_creation_timeout (int): Time to wait for the bucket object creation. """ logger.info( @@ -96,7 +103,11 @@ def create_resources( self.obc_objs.extend(rgw_bucket_factory(1, "rgw-oc")) if bucket_factory: - self.obc_objs.extend(bucket_factory(amount=1, interface="OC")) + self.obc_objs.extend( + bucket_factory( + amount=1, interface="OC", timeout=bucket_creation_timeout + ) + ) self.ceph_cluster.wait_for_noobaa_health_ok() diff --git a/tests/functional/z_cluster/cluster_expansion/test_add_capacity_entry_exit_criteria.py b/tests/functional/z_cluster/cluster_expansion/test_add_capacity_entry_exit_criteria.py index 522051a69fe..fb0c8470f75 100644 --- a/tests/functional/z_cluster/cluster_expansion/test_add_capacity_entry_exit_criteria.py +++ b/tests/functional/z_cluster/cluster_expansion/test_add_capacity_entry_exit_criteria.py @@ -58,6 +58,7 @@ def finalizer(): kr_obj = OSDKeyrotation() kr_obj.set_keyrotation_schedule("@weekly") kr_obj.enable_keyrotation() + cluster_helpers.check_ceph_health_after_add_capacity() request.addfinalizer(finalizer) @@ -98,19 +99,21 @@ def test_add_capacity( # All OCS pods are in running state: # ToDo https://github.com/red-hat-storage/ocs-ci/issues/2361 - assert ( - pod_helpers.check_pods_in_running_state() + expected_statuses = [constants.STATUS_RUNNING, constants.STATUS_COMPLETED] + assert pod_helpers.check_pods_in_statuses( + expected_statuses=expected_statuses, + exclude_pod_name_prefixes=["demo-pod"], ), "Entry criteria FAILED: one or more OCS pods are not in running state" # Create the namespace under which this test will execute: project = project_factory() # total pvc created will be 'num_of_pvcs' * 4 types of pvcs(rbd-rwo,rwx # & cephfs-rwo,rwx) - num_of_pvcs = 40 + num_of_pvcs = 20 rwo_rbd_pods = multi_dc_pod( num_of_pvcs=num_of_pvcs, - pvc_size=175, + pvc_size=150, project=project, access_mode="RWO", pool_type="rbd", @@ -124,7 +127,7 @@ def test_add_capacity( # Create rwx-rbd pods pods_ios_rwx_rbd = multi_dc_pod( num_of_pvcs=10, - pvc_size=175, + pvc_size=150, project=project, access_mode="RWX-BLK", pool_type="rbd", @@ -159,7 +162,7 @@ def test_add_capacity( bg_wrap.wrap, cluster_exp_helpers.cluster_copy_ops, p, - iterations=200, + iterations=120, ) ) @@ -171,7 +174,7 @@ def test_add_capacity( multi_pvc_factory, pod_factory, project, - iterations=200, + iterations=120, ) # Start NooBaa IOs in the background.: @@ -183,7 +186,7 @@ def test_add_capacity( mcg_obj, awscli_pod, bucket_factory, - iterations=200, + iterations=120, ) logger.info("Started obc_io_create_delete...") @@ -194,7 +197,7 @@ def test_add_capacity( mcg_obj, awscli_pod, bucket_factory, - iterations=200, + iterations=120, ) # All ocs nodes are in Ready state (including master): @@ -341,7 +344,11 @@ def test_add_capacity( ]: # Change the method of creating resources when we use vSphere and IBM Cloud platforms self.sanity_helpers.create_resources( - pvc_factory, pod_factory, bucket_factory, rgw_bucket_factory + pvc_factory, + pod_factory, + bucket_factory, + rgw_bucket_factory, + bucket_creation_timeout=360, ) else: num_of_pvcs = 1