From 05a7bb53feb063b7677edb9351413a8792556e3a Mon Sep 17 00:00:00 2001 From: Filip Balak Date: Wed, 31 Jan 2024 17:07:50 +0100 Subject: [PATCH] Verify that default noobaa backingstore uses rgw endpoint on provider (#9243) * Verify that default noobaa backingstore uses rgw endpoint on provider Signed-off-by: fbalak * fix import Signed-off-by: fbalak * fix parameter and add log Signed-off-by: fbalak * fix parameter and add log Signed-off-by: fbalak * fix index Signed-off-by: fbalak * move test_verify_backingstore_uses_rgw to test_provider_client.py Signed-off-by: fbalak --------- Signed-off-by: fbalak --- ocs_ci/ocs/constants.py | 1 + .../object/mcg/test_provider_client.py | 41 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 tests/functional/object/mcg/test_provider_client.py diff --git a/ocs_ci/ocs/constants.py b/ocs_ci/ocs/constants.py index 70be245ac15..d9b5b44f6a5 100644 --- a/ocs_ci/ocs/constants.py +++ b/ocs_ci/ocs/constants.py @@ -126,6 +126,7 @@ CEPHBLOCKPOOL_THICK = "CephBlockPoolThick" CEPHBLOCKPOOL_SC = "ocs-storagecluster-ceph-rbd" CEPHFILESYSTEM_SC = "ocs-storagecluster-cephfs" +CEPHOBJECTSTORE = "CephObjectStore" LVM_SC = "lvms-vg1" NOOBAA_SC = "openshift-storage.noobaa.io" LOCALSTORAGE_SC = "localblock" diff --git a/tests/functional/object/mcg/test_provider_client.py b/tests/functional/object/mcg/test_provider_client.py new file mode 100644 index 00000000000..223c8cc576b --- /dev/null +++ b/tests/functional/object/mcg/test_provider_client.py @@ -0,0 +1,41 @@ +import logging + +from ocs_ci.framework.pytest_customization.marks import ( + tier1, + red_squad, + runs_on_provider, + mcg, + provider_client_ms_platform_required, +) +from ocs_ci.ocs import constants +from ocs_ci.ocs.ocp import OCP +from ocs_ci.framework.testlib import polarion_id + +log = logging.getLogger(__name__) + + +@mcg +@red_squad +@runs_on_provider +@provider_client_ms_platform_required +@tier1 +@polarion_id("OCS-5415") +def test_verify_backingstore_uses_rgw(mcg_obj_session): + """ + Validates whether default MCG backingstore uses rgw endpoint + """ + ceph_object_store = OCP( + kind=constants.CEPHOBJECTSTORE, + resource_name="ocs-storagecluster-cephobjectstore", + ).get() + log.debug(f"Ceph object store: {ceph_object_store}") + rgw_endpoint = ceph_object_store["status"]["endpoints"]["secure"][0] + log.info( + f"Checking if backingstore noobaa-default-backing-store uses endpoint {rgw_endpoint}" + ) + + # Get default backingstore status + backingstore_data = mcg_obj_session.exec_mcg_cmd( + "backingstore status noobaa-default-backing-store" + ).stdout + assert f"endpoint: {rgw_endpoint}" in backingstore_data