From d21011eb60884eb53135447d68c179e8ed951834 Mon Sep 17 00:00:00 2001 From: fbalak Date: Mon, 29 Jan 2024 14:53:22 +0100 Subject: [PATCH 1/6] Verify that default noobaa backingstore uses rgw endpoint on provider Signed-off-by: fbalak --- ocs_ci/ocs/constants.py | 1 + .../object/mcg/test_verify_noobaa_status.py | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/ocs_ci/ocs/constants.py b/ocs_ci/ocs/constants.py index 2a5786e596e..3c499c4c8a7 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_verify_noobaa_status.py b/tests/functional/object/mcg/test_verify_noobaa_status.py index 9bfab79c615..38b9175554e 100644 --- a/tests/functional/object/mcg/test_verify_noobaa_status.py +++ b/tests/functional/object/mcg/test_verify_noobaa_status.py @@ -6,7 +6,9 @@ skipif_ocs_version, skipif_openshift_dedicated, red_squad, + runs_on_provider, mcg, + provider_client_ms_platform_required, ) from ocs_ci.ocs import constants from ocs_ci.ocs.resources.pod import get_pod_logs @@ -62,3 +64,25 @@ def test_verify_noobaa_db_service(mcg_obj_session): assert ( re.search(pattern=pattern, string=noobaa_db_log) is None ), f"Error: {pattern} msg found in the noobaa db logs." + + +@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, name="ocs-storagecluster-cephobjectstore" + ).get()["items"][0] + rgw_endpoint = ceph_object_store["status"]["endpoints"]["secure"] + + # 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 From 11b60bf109f7aedc655d25eb1c2efa96d74d8e5b Mon Sep 17 00:00:00 2001 From: fbalak Date: Mon, 29 Jan 2024 15:03:10 +0100 Subject: [PATCH 2/6] fix import Signed-off-by: fbalak --- tests/functional/object/mcg/test_verify_noobaa_status.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/functional/object/mcg/test_verify_noobaa_status.py b/tests/functional/object/mcg/test_verify_noobaa_status.py index 38b9175554e..d38beef4173 100644 --- a/tests/functional/object/mcg/test_verify_noobaa_status.py +++ b/tests/functional/object/mcg/test_verify_noobaa_status.py @@ -11,6 +11,7 @@ provider_client_ms_platform_required, ) from ocs_ci.ocs import constants +from ocs_ci.ocs.ocp import OCP from ocs_ci.ocs.resources.pod import get_pod_logs from ocs_ci.framework.testlib import polarion_id, bugzilla from ocs_ci.framework.pytest_customization.marks import skipif_managed_service From 7e9cb6e1662dac38e100a6d89b536101401eac55 Mon Sep 17 00:00:00 2001 From: fbalak Date: Tue, 30 Jan 2024 10:28:03 +0100 Subject: [PATCH 3/6] fix parameter and add log Signed-off-by: fbalak --- tests/functional/object/mcg/test_verify_noobaa_status.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/functional/object/mcg/test_verify_noobaa_status.py b/tests/functional/object/mcg/test_verify_noobaa_status.py index d38beef4173..9e55190bfd1 100644 --- a/tests/functional/object/mcg/test_verify_noobaa_status.py +++ b/tests/functional/object/mcg/test_verify_noobaa_status.py @@ -78,9 +78,13 @@ def test_verify_backingstore_uses_rgw(mcg_obj_session): Validates whether default MCG backingstore uses rgw endpoint """ ceph_object_store = OCP( - kind=constants.CEPHOBJECTSTORE, name="ocs-storagecluster-cephobjectstore" + kind=constants.CEPHOBJECTSTORE, + resource_name="ocs-storagecluster-cephobjectstore", ).get()["items"][0] rgw_endpoint = ceph_object_store["status"]["endpoints"]["secure"] + 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( From a6e11b474b33cd5516df4985aa0138d2753f9f94 Mon Sep 17 00:00:00 2001 From: fbalak Date: Tue, 30 Jan 2024 11:17:24 +0100 Subject: [PATCH 4/6] fix parameter and add log Signed-off-by: fbalak --- tests/functional/object/mcg/test_verify_noobaa_status.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/functional/object/mcg/test_verify_noobaa_status.py b/tests/functional/object/mcg/test_verify_noobaa_status.py index 9e55190bfd1..c6c57a5936b 100644 --- a/tests/functional/object/mcg/test_verify_noobaa_status.py +++ b/tests/functional/object/mcg/test_verify_noobaa_status.py @@ -80,7 +80,8 @@ def test_verify_backingstore_uses_rgw(mcg_obj_session): ceph_object_store = OCP( kind=constants.CEPHOBJECTSTORE, resource_name="ocs-storagecluster-cephobjectstore", - ).get()["items"][0] + ).get() + log.debug(f"Ceph object store: {ceph_object_store}") rgw_endpoint = ceph_object_store["status"]["endpoints"]["secure"] log.info( f"Checking if backingstore noobaa-default-backing-store uses endpoint {rgw_endpoint}" From 68ef13d6bfd3f9938138814c43ee9860f57ee424 Mon Sep 17 00:00:00 2001 From: fbalak Date: Tue, 30 Jan 2024 12:12:12 +0100 Subject: [PATCH 5/6] fix index Signed-off-by: fbalak --- tests/functional/object/mcg/test_verify_noobaa_status.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/functional/object/mcg/test_verify_noobaa_status.py b/tests/functional/object/mcg/test_verify_noobaa_status.py index c6c57a5936b..348fdcd8462 100644 --- a/tests/functional/object/mcg/test_verify_noobaa_status.py +++ b/tests/functional/object/mcg/test_verify_noobaa_status.py @@ -82,7 +82,7 @@ def test_verify_backingstore_uses_rgw(mcg_obj_session): resource_name="ocs-storagecluster-cephobjectstore", ).get() log.debug(f"Ceph object store: {ceph_object_store}") - rgw_endpoint = ceph_object_store["status"]["endpoints"]["secure"] + rgw_endpoint = ceph_object_store["status"]["endpoints"]["secure"][0] log.info( f"Checking if backingstore noobaa-default-backing-store uses endpoint {rgw_endpoint}" ) From ca8c9280d8ddca53dea6f0d8357afe739855fb02 Mon Sep 17 00:00:00 2001 From: fbalak Date: Wed, 31 Jan 2024 11:02:50 +0100 Subject: [PATCH 6/6] move test_verify_backingstore_uses_rgw to test_provider_client.py Signed-off-by: fbalak --- .../object/mcg/test_provider_client.py | 41 +++++++++++++++++++ .../object/mcg/test_verify_noobaa_status.py | 30 -------------- 2 files changed, 41 insertions(+), 30 deletions(-) create mode 100644 tests/functional/object/mcg/test_provider_client.py 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 diff --git a/tests/functional/object/mcg/test_verify_noobaa_status.py b/tests/functional/object/mcg/test_verify_noobaa_status.py index 348fdcd8462..9bfab79c615 100644 --- a/tests/functional/object/mcg/test_verify_noobaa_status.py +++ b/tests/functional/object/mcg/test_verify_noobaa_status.py @@ -6,12 +6,9 @@ skipif_ocs_version, skipif_openshift_dedicated, 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.ocs.resources.pod import get_pod_logs from ocs_ci.framework.testlib import polarion_id, bugzilla from ocs_ci.framework.pytest_customization.marks import skipif_managed_service @@ -65,30 +62,3 @@ def test_verify_noobaa_db_service(mcg_obj_session): assert ( re.search(pattern=pattern, string=noobaa_db_log) is None ), f"Error: {pattern} msg found in the noobaa db logs." - - -@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