Skip to content

Commit

Permalink
Reduce the number of PVCs created and IO running, increase timeout wa…
Browse files Browse the repository at this point in the history
…it for noobaa bucket, fix small issue wait for pods, wait for ceph health in the test teardown (red-hat-storage#10072)

Signed-off-by: Itzhak Kave <[email protected]>
Co-authored-by: Itzhak Kave <[email protected]>
  • Loading branch information
2 people authored and Amrita Mahapatra committed Jul 25, 2024
1 parent e98a1e5 commit 515d10d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
15 changes: 13 additions & 2 deletions ocs_ci/helpers/sanity_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand All @@ -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()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -159,7 +162,7 @@ def test_add_capacity(
bg_wrap.wrap,
cluster_exp_helpers.cluster_copy_ops,
p,
iterations=200,
iterations=120,
)
)

Expand All @@ -171,7 +174,7 @@ def test_add_capacity(
multi_pvc_factory,
pod_factory,
project,
iterations=200,
iterations=120,
)

# Start NooBaa IOs in the background.:
Expand All @@ -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...")
Expand All @@ -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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 515d10d

Please sign in to comment.