Skip to content

Commit

Permalink
Add keyword to find cluster type based on infrastructure
Browse files Browse the repository at this point in the history
  • Loading branch information
ChughShilpa committed Jan 3, 2025
1 parent 0290749 commit b83fdf1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 17 deletions.
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 @@ Wait For Namespace To Be Active
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
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

0 comments on commit b83fdf1

Please sign in to comment.