Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add keyword to find cluster type based on cluster infrastructure #2154

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions ods_ci/tests/Resources/Common.robot
Original file line number Diff line number Diff line change
Expand Up @@ -601,14 +601,14 @@ Skip If Operator Starting Version Is Not Supported
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
[Documentation] Skips test if cluster type is Self-managed
${cluster_type}= Is Cluster Type Managed
Skip If condition=${cluster_type}==False 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
[Documentation] Skips test if cluster type is Managed
${cluster_type}= Is Cluster Type Managed
Skip If condition=${cluster_type}==True msg=This test is skipped for Managed cluster

Delete All ${resource_type} In Namespace By Name
[Documentation] Force delete all ${resource_type} named '${resource_type}' in namespace '${namespace}'
Expand Down
20 changes: 9 additions & 11 deletions ods_ci/tests/Resources/OCP.resource
Original file line number Diff line number Diff line change
Expand Up @@ -333,17 +333,15 @@
Log ${value}
Should Be Equal As Integers ${rc} 0

Is Cluster Type Self-Managed
jgarciao marked this conversation as resolved.
Show resolved Hide resolved
[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
Is Cluster Type Managed
[Documentation] Find the cluster type based on output of the infrastructure of the cluster
... Returns ${TRUE} if cluster type is Managed
... Returns ${FALSE} if cluster type is Self-Managed
${rc} ${output}= Run And Return Rc And Output
... oc get infrastructure cluster -o jsonpath='{.status.platformStatus.*.resourceTags[?(@.key=="red-hat-managed")].value}'

Check warning

Code scanning / Robocop

Line is too long ({{ line_length }}/{{ allowed_length }}) Warning test

Line is too long (129/120)
Should Be Equal As Integers ${rc} 0
IF "${output}" == "true"
RETURN ${TRUE}
ELSE
RETURN ${FALSE}
END
Expand Down
Loading