Skip to content

Commit

Permalink
Add keyword to find ROSA_HCP environment (#2143)
Browse files Browse the repository at this point in the history
Add keyword to find test environment
  • Loading branch information
ChughShilpa authored Jan 3, 2025
1 parent cfad0f2 commit 0290749
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 20 deletions.
13 changes: 13 additions & 0 deletions ods_ci/tests/Resources/OCP.resource
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,16 @@ Is Cluster Type Self-Managed
ELSE
RETURN ${FALSE}
END

Is Test Enviroment ROSA-HCP
[Documentation] Find the test environment based on output of the infrastructure of the cluster
... Returns ${TRUE} if test environment is ROSA_HCP
... Returns ${FALSE} if test environment is not ROSA_HCP
${rc} ${output}= Run And Return Rc And Output
... oc get infrastructure cluster -o jsonpath='{.metadata.labels.hypershift\\.openshift\\.io/managed}'
Should Be Equal As Integers ${rc} 0
IF "${output}" == "true"
RETURN ${TRUE}
ELSE
RETURN ${FALSE}
END
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Documentation This is a resource file for Distributed Workloads.
Library OperatingSystem
Library Process
Resource ../../../../tasks/Resources/RHODS_OLM/install/oc_install.robot


*** Variables ***
Expand Down Expand Up @@ -256,3 +257,17 @@ Check missing Go test
[Documentation] Check that upstream Go test is not missing
[Arguments] ${test_run_output}
Should Not Contain ${test_run_output} testing: warning: no tests to run No Go tests were run

Verify container images
[Documentation] Verify container images
[Arguments] ${pod_name} ${container} ${expected_image}
${test_env}= Is Test Enviroment ROSA-HCP
# We use Kyverno custom policies to pull unreleased images from quay registry for hypershift clusters
${registry_name} = Set Variable If ${test_env}==True
... quay.io
... registry.redhat.io
Log To Console Verifying ${pod_name}'s container image is referred from ${registry_name}
${pod} = Find First Pod By Name namespace=${APPLICATIONS_NAMESPACE} pod_regex=${pod_name}
Container Image Url Should Contain ${APPLICATIONS_NAMESPACE} ${pod} ${container}
... ${registry_name}/rhoai/${expected_image}
Log To Console ${pod_name}'s container image is verified
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Documentation Smoke tests for Workloads Orchestration
Library Process
Resource ../../../../tasks/Resources/RHODS_OLM/install/oc_install.robot
Resource ../../../Resources/Page/DistributedWorkloads/DistributedWorkloads.resource


*** Test Cases ***
Expand All @@ -25,8 +26,4 @@ Kueue smoke test
FAIL Can not find kueue-webhook-service service in ${APPLICATIONS_NAMESPACE}
END
Log To Console kueue-webhook-service service exists
Log To Console Verifying kueue-controller-manager's container image is referred from registry.redhat.io
${pod} = Find First Pod By Name namespace=${APPLICATIONS_NAMESPACE} pod_regex=kueue-controller-manager-
Container Image Url Should Contain ${APPLICATIONS_NAMESPACE} ${pod} manager
... registry.redhat.io/rhoai/odh-kueue-controller
Log To Console kueue-controller-manager's container image is verified
Verify container images kueue-controller-manager manager odh-kueue-controller
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Documentation Smoke tests for Workloads Training
Library Process
Resource ../../../../tasks/Resources/RHODS_OLM/install/oc_install.robot
Resource ../../../Resources/Page/DistributedWorkloads/DistributedWorkloads.resource
Suite Setup Prepare Codeflare E2E Test Suite
Suite Teardown Teardown Codeflare E2E Test Suite

Expand All @@ -28,11 +29,7 @@ Ray smoke test
FAIL Can not find kuberay-operator service in ${APPLICATIONS_NAMESPACE}
END
Log To Console kuberay-operator service exists
Log To Console Verifying kuberay-operator's container image is referred from registry.redhat.io
${pod} = Find First Pod By Name namespace=${APPLICATIONS_NAMESPACE} pod_regex=kuberay-operator-
Container Image Url Should Contain ${APPLICATIONS_NAMESPACE} ${pod} kuberay-operator
... registry.redhat.io/rhoai/odh-kuberay-operator-controller
Log To Console kuberay-operator's container image is verified
Verify container images kuberay-operator kuberay-operator odh-kuberay-operator-controller

Codeflare smoke test
[Documentation] Check that Codeflare deployment and its monitoring service are up and running
Expand All @@ -54,11 +51,7 @@ Codeflare smoke test
FAIL Can not find codeflare-operator-manager-metrics service in ${APPLICATIONS_NAMESPACE}
END
Log To Console codeflare-operator-manager-metrics service exists
Log To Console Verifying codeflare-operator-manager's container image is referred from registry.redhat.io
${pod} = Find First Pod By Name namespace=${APPLICATIONS_NAMESPACE} pod_regex=codeflare-operator-manager-
Container Image Url Should Contain ${APPLICATIONS_NAMESPACE} ${pod} manager
... registry.redhat.io/rhoai/odh-codeflare-operator
Log To Console codeflare-operator-manager's container image is verified
Verify container images codeflare-operator-manager manager odh-codeflare-operator

Training operator smoke test
[Documentation] Check that Training operator deployment is up and running
Expand All @@ -72,11 +65,7 @@ Training operator smoke test
IF ${result.rc} != 0
FAIL Timeout waiting for deployment/kubeflow-training-operator to be available in ${APPLICATIONS_NAMESPACE}
END
Log To Console Verifying kubeflow-training-operator's container image is referred from registry.redhat.io
${pod} = Find First Pod By Name namespace=${APPLICATIONS_NAMESPACE} pod_regex=kubeflow-training-operator-
Container Image Url Should Contain ${APPLICATIONS_NAMESPACE} ${pod} training-operator
... registry.redhat.io/rhoai/odh-training-operator
Log To Console kubeflow-training-operator's container image is verified
Verify container images kubeflow-training-operator training-operator odh-training-operator


*** Keywords ***
Expand Down

0 comments on commit 0290749

Please sign in to comment.