Skip to content

Commit

Permalink
Add storagerequests check
Browse files Browse the repository at this point in the history
Signed-off-by: Elena Bondarenko <[email protected]>
  • Loading branch information
ebondare committed May 28, 2024
1 parent 469e5f1 commit 3fc45dc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
21 changes: 21 additions & 0 deletions ocs_ci/helpers/managed_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -962,3 +962,24 @@ def create_toolbox_on_faas_consumer():
resource_count=1,
timeout=180,
)


def verify_provider_after_client_onboarding():
"""
Verify resources on provider cluster after client onboarding:
1. There are 2 storagerequests for each storageconsumer, and their status is Ready
"""
storagerequests_obj = OCP(
kind=constants.STORAGEREQUEST, namespace=config.ENV_DATA["cluster_namespace"]
)
storagerequests = storagerequests_obj.get().get("items")
storageconsumer_obj = OCP(
kind=constants.STORAGECONSUMER, namespace=config.ENV_DATA["cluster_namespace"]
)
storageconsumers = storageconsumer_obj.get().get("items")
assert len(storagerequests) == 2 * len(
storageconsumers
), f"There should be 2 storagerequests for each storageconsumer"
for storagerequest in storagerequests:
assert storagerequest.get("status").get("phase") == constants.STATUS_READY
2 changes: 2 additions & 0 deletions ocs_ci/ocs/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
LVMCLUSTER = "odf-lvmcluster"
LVMSCLUSTER = "lvmscluster"
STORAGECLASSCLAIM = "StorageClassClaim"
STORAGECLAIM = "StorageClaim"
STORAGECONSUMER = "StorageConsumer"
MACHINEHEALTHCHECK = "machinehealthcheck"
STORAGECLIENT = "StorageClient"
Expand All @@ -197,6 +198,7 @@
ROOK_CEPH_WEBHOOK = "rook-ceph-webhook"
REPLICATION_SOURCE = "ReplicationSource"
REPLICATIONDESTINATION = "ReplicationDestination"
STORAGEREQUEST = "Storagerequest"

# Provisioners
AWS_EFS_PROVISIONER = "openshift.org/aws-efs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from ocs_ci.framework import config
from ocs_ci.ocs import constants, managedservice, ocp
from ocs_ci.ocs.resources import pod, storage_cluster
from ocs_ci.helpers import managed_services
from ocs_ci.framework.pytest_customization.marks import yellow_squad
from ocs_ci.framework.testlib import (
acceptance,
Expand All @@ -30,6 +31,7 @@ class TestPostInstallationState(ManageTest):
@provider_client_ms_platform_required
def test_post_installation(self):
storage_cluster.ocs_install_verification()
managed_services.verify_provider_after_client_onboarding()

@acceptance
@pc_or_ms_provider_required
Expand Down

0 comments on commit 3fc45dc

Please sign in to comment.