From 8f682385e17716237c9d9b12f2b805ae049ac314 Mon Sep 17 00:00:00 2001 From: Shilpa Chugh Date: Tue, 24 Dec 2024 18:52:16 +0530 Subject: [PATCH] Add keyword to find test environment --- ods_ci/tests/Resources/OCP.resource | 13 ++++ .../test-smoke.robot | 20 +++++-- .../0602__training/test-smoke.robot | 60 ++++++++++++++----- 3 files changed, 73 insertions(+), 20 deletions(-) diff --git a/ods_ci/tests/Resources/OCP.resource b/ods_ci/tests/Resources/OCP.resource index f5498b9c8..3fc281995 100644 --- a/ods_ci/tests/Resources/OCP.resource +++ b/ods_ci/tests/Resources/OCP.resource @@ -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 diff --git a/ods_ci/tests/Tests/0600__distributed_workloads/0601__workloads_orchestration/test-smoke.robot b/ods_ci/tests/Tests/0600__distributed_workloads/0601__workloads_orchestration/test-smoke.robot index 6695d05ff..dc7abe9d1 100644 --- a/ods_ci/tests/Tests/0600__distributed_workloads/0601__workloads_orchestration/test-smoke.robot +++ b/ods_ci/tests/Tests/0600__distributed_workloads/0601__workloads_orchestration/test-smoke.robot @@ -25,8 +25,18 @@ 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 + ${test_env}= Is Test Enviroment ROSA-HCP + IF ${test_env}==True + # We use Kyverno custom policies to pull unreleased images from quay registry for hypershift clusters + Log To Console Verifying kueue-controller-manager's container image is referred from quay.io + ${pod} = Find First Pod By Name namespace=${APPLICATIONS_NAMESPACE} pod_regex=kueue-controller-manager- + Container Image Url Should Contain ${APPLICATIONS_NAMESPACE} ${pod} manager + ... quay.io/rhoai/odh-kueue-controller + Log To Console kueue-controller-manager's container image is verified + ELSE + 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 + END diff --git a/ods_ci/tests/Tests/0600__distributed_workloads/0602__training/test-smoke.robot b/ods_ci/tests/Tests/0600__distributed_workloads/0602__training/test-smoke.robot index 5d4f28989..37d4fb198 100644 --- a/ods_ci/tests/Tests/0600__distributed_workloads/0602__training/test-smoke.robot +++ b/ods_ci/tests/Tests/0600__distributed_workloads/0602__training/test-smoke.robot @@ -28,11 +28,21 @@ 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 + ${test_env}= Is Test Enviroment ROSA-HCP + IF ${test_env}==True + # We use Kyverno custom policies to pull unreleased images from quay registry for hypershift clusters + Log To Console Verifying kuberay-operator's container image is referred from quay.io + ${pod} = Find First Pod By Name namespace=${APPLICATIONS_NAMESPACE} pod_regex=kuberay-operator- + Container Image Url Should Contain ${APPLICATIONS_NAMESPACE} ${pod} kuberay-operator + ... quay.io/rhoai/odh-kuberay-operator-controller + Log To Console kuberay-operator's container image is verified + ELSE + 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 + END Codeflare smoke test [Documentation] Check that Codeflare deployment and its monitoring service are up and running @@ -54,11 +64,21 @@ 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 + ${test_env}= Is Test Enviroment ROSA-HCP + IF ${test_env}==True + # We use Kyverno custom policies to pull unreleased images from quay registry for hypershift clusters + Log To Console Verifying codeflare-operator-manager's container image is referred from quay.io + ${pod} = Find First Pod By Name namespace=${APPLICATIONS_NAMESPACE} pod_regex=codeflare-operator-manager- + Container Image Url Should Contain ${APPLICATIONS_NAMESPACE} ${pod} manager + ... quay.io/rhoai/odh-codeflare-operator + Log To Console codeflare-operator-manager's container image is verified + ELSE + 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 + END Training operator smoke test [Documentation] Check that Training operator deployment is up and running @@ -72,11 +92,21 @@ 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 + ${test_env}= Is Test Enviroment ROSA-HCP + IF ${test_env}==True + # We use Kyverno custom policies to pull unreleased images from quay registry for hypershift clusters + Log To Console Verifying kubeflow-training-operator's container image is referred from quay.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 + ... quay.io/rhoai/odh-training-operator + Log To Console kubeflow-training-operator's container image is verified + ELSE + 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 + END *** Keywords ***