From d6fea92562bd637c11153e61e74c6742a54444ae Mon Sep 17 00:00:00 2001 From: Shilpa Chugh Date: Wed, 27 Nov 2024 15:55:53 +0530 Subject: [PATCH] Add keywords to skip tests on Self managed cluster (#2074) Add method to skip tests on Self managed cluster --- ods_ci/tests/Resources/Common.robot | 10 ++++++++++ ods_ci/tests/Resources/OCP.resource | 15 +++++++++++++++ ...test-run-distributed-workloads-tests_3.9.robot | 2 +- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/ods_ci/tests/Resources/Common.robot b/ods_ci/tests/Resources/Common.robot index 6fd0dd623..0effa0e3f 100644 --- a/ods_ci/tests/Resources/Common.robot +++ b/ods_ci/tests/Resources/Common.robot @@ -587,3 +587,13 @@ Skip If Operator Starting Version Is Not Supported [Arguments] ${minimum_version} ${supported}= Is Starting Version Supported minimum_version=${minimum_version} Skip If condition="${supported}"=="${FALSE}" msg=This test is skipped because starting operator version < ${minimum_version} + +Skip If Cluster Type Is Self-Managed + [Documentation] Skips test if cluster type is Self-managed + ${cluster_type}= Is Cluster Type Self-Managed + Skip If condition=${cluster_type}==True msg=This test is skipped for Self-managed cluster + +Skip If Cluster Type Is Managed + [Documentation] Skips test if cluster type is Managed + ${cluster_type}= Is Cluster Type Self-Managed + Skip If condition=${cluster_type}==False msg=This test is skipped for Managed cluster diff --git a/ods_ci/tests/Resources/OCP.resource b/ods_ci/tests/Resources/OCP.resource index a68b52b53..f5498b9c8 100644 --- a/ods_ci/tests/Resources/OCP.resource +++ b/ods_ci/tests/Resources/OCP.resource @@ -332,3 +332,18 @@ Wait For Namespace To Be Active Log ${rc} Log ${value} Should Be Equal As Integers ${rc} 0 + +Is Cluster Type Self-Managed + [Documentation] Get the value of cluster type depending on the console URL domain + ... Returns ${TRUE} if cluster type is Self-Managed + ... Returns ${FALSE} if cluster type is Managed + ${matches}= Get Regexp Matches ${OCP_CONSOLE_URL} rh-ods + ${size}= Get Length ${matches} + IF ${size}>0 + ${domain}= Get From List ${matches} 0 + IF "${domain}" == "rh-ods" + RETURN ${TRUE} + END + ELSE + RETURN ${FALSE} + END diff --git a/ods_ci/tests/Tests/0600__distributed_workloads/test-run-distributed-workloads-tests_3.9.robot b/ods_ci/tests/Tests/0600__distributed_workloads/test-run-distributed-workloads-tests_3.9.robot index ab3581327..4920c98d3 100644 --- a/ods_ci/tests/Tests/0600__distributed_workloads/test-run-distributed-workloads-tests_3.9.robot +++ b/ods_ci/tests/Tests/0600__distributed_workloads/test-run-distributed-workloads-tests_3.9.robot @@ -79,7 +79,7 @@ Prepare DistributedWorkloads Integration Test Suite for 3.9 [Documentation] Prepare DistributedWorkloads Integration Test Suite for 3.9 # The bug fix for self signed certificate error is not available in codeflare-sdk version "v0.21.1" which is the # last supported release for python 3.9 and hence skipping tests for self managed installtion - Skip If RHODS Is Self-Managed + Skip If Cluster Type Is Self-Managed Log To Console "Downloading compiled test binary ${ODH_BINARY_NAME}" ${result} = Run Process curl --location --silent --output ${ODH_BINARY_NAME} ${DISTRIBUTED_WORKLOADS_RELEASE_ASSETS_3.9}/${ODH_BINARY_NAME} && chmod +x ${ODH_BINARY_NAME}