From e15eb4de584ee0142845cca81709f43c79db437c Mon Sep 17 00:00:00 2001 From: asanzgom Date: Wed, 6 Mar 2024 17:01:21 +0100 Subject: [PATCH] RHOAIENG-2508 ODS-2600 Validate DSC creates all Serverless CRs --- .../InstalledOperators.robot | 8 +- .../130__rhods_operator.robot | 2 +- ...rhods_operator_oom_kill_verification.robot | 2 +- .../140__serverless_operator.robot | 111 ++++++++++++++++++ .../400__ods_dashboard.robot | 6 +- ...s_dashboard_projects_notebook_images.robot | 2 +- .../620__intel_aikit/620__intel_aikit.robot | 2 +- .../660__openvino/660__openvino.robot | 2 +- .../670__pachyderm/670__pachyderm.robot | 2 +- 9 files changed, 124 insertions(+), 13 deletions(-) create mode 100644 ods_ci/tests/Tests/100__deploy/130__operators/140__serverless_operator/140__serverless_operator.robot diff --git a/ods_ci/tests/Resources/Page/OCPDashboard/InstalledOperators/InstalledOperators.robot b/ods_ci/tests/Resources/Page/OCPDashboard/InstalledOperators/InstalledOperators.robot index 308af9866..b51d1cb83 100644 --- a/ods_ci/tests/Resources/Page/OCPDashboard/InstalledOperators/InstalledOperators.robot +++ b/ods_ci/tests/Resources/Page/OCPDashboard/InstalledOperators/InstalledOperators.robot @@ -141,7 +141,7 @@ Delete Tabname Instance For Installed Operator Wait Until Element Is Enabled //button[contains(text(),"Delete")] Click Button Delete -Check If Operator Is Already Installed In Opneshift +Check If Operator Is Already Installed In Openshift [Documentation] This keyword verify if operator is already installed and return the status [Arguments] ${operator_name} Open Installed Operators Page @@ -150,18 +150,18 @@ Check If Operator Is Already Installed In Opneshift IF ${status} Log To Console Operator "${operator_name}" is already installed RETURN ${status} -Check And Install Operator in Openshift +Check And Install Operator In Openshift [Documentation] This keyword verify if operator is already installed or not ... If not installed it matched the no of operator present and installs the operator [Arguments] ${operator_name} ${operator_appname} ${expected_number_operator}=2 - ${status} Check If Operator Is Already Installed In Opneshift ${operator_name} + ${status} Check If Operator Is Already Installed In Openshift ${operator_name} IF not ${status} Open OperatorHub ${actual_no_of_operator} Get The Number of Operator Available ${operator_appname} IF ${actual_no_of_operator} == ${expected_number_operator} Install Operator ${operator_appname} ELSE - FAIL Only ${actual_no_of_operator} ${operator_name} is found in Opearatorhub + FAIL Only ${actual_no_of_operator} ${operator_name} is found in Operatorhub END END diff --git a/ods_ci/tests/Tests/100__deploy/130__operators/130__rhods_operator/130__rhods_operator.robot b/ods_ci/tests/Tests/100__deploy/130__operators/130__rhods_operator/130__rhods_operator.robot index d612d08ff..6d47fad48 100644 --- a/ods_ci/tests/Tests/100__deploy/130__operators/130__rhods_operator/130__rhods_operator.robot +++ b/ods_ci/tests/Tests/100__deploy/130__operators/130__rhods_operator/130__rhods_operator.robot @@ -21,7 +21,7 @@ Verify RHODS operator information [Tags] ODS-498 ODS-624 Sanity ProductBug Tier1 Open Installed Operators Page #Select All Projects - Wait Until Keyword Succeeds 10 times 5s Click On Searched Operator Red Hat OpenShift Data Science #robocop: disable + Wait Until Keyword Succeeds 10 times 5s Click On Searched Operator Red Hat OpenShift AI #robocop: disable ${link_elements}= Get WebElements xpath=//*[@class="co-clusterserviceversion-details__field"]//a #Temporary List to hold the url for the verification ${temp_list} Create List diff --git a/ods_ci/tests/Tests/100__deploy/130__operators/130__rhods_operator/138__rhods_operator_oom_kill_verification.robot b/ods_ci/tests/Tests/100__deploy/130__operators/130__rhods_operator/138__rhods_operator_oom_kill_verification.robot index 65c4fda73..ad80bf6e7 100644 --- a/ods_ci/tests/Tests/100__deploy/130__operators/130__rhods_operator/138__rhods_operator_oom_kill_verification.robot +++ b/ods_ci/tests/Tests/100__deploy/130__operators/130__rhods_operator/138__rhods_operator_oom_kill_verification.robot @@ -50,7 +50,7 @@ Create Namespace In Openshift Log ${temp_count} Delete Namespace From Openshift - [Documentation] Delete dummy namespace from opneshift + [Documentation] Delete dummy namespace from openshift [Arguments] ${number}=${NUMBER} ${delete_namespace} Run oc delete namespace --selector testuser=testuser ${temp_count} Run oc get namespace | wc -l diff --git a/ods_ci/tests/Tests/100__deploy/130__operators/140__serverless_operator/140__serverless_operator.robot b/ods_ci/tests/Tests/100__deploy/130__operators/140__serverless_operator/140__serverless_operator.robot new file mode 100644 index 000000000..2a665f683 --- /dev/null +++ b/ods_ci/tests/Tests/100__deploy/130__operators/140__serverless_operator/140__serverless_operator.robot @@ -0,0 +1,111 @@ +*** Settings *** +Documentation Test Cases to verify Serverless installation +Library Collections +Library SeleniumLibrary +Library OpenShiftLibrary +Resource ../../../../Resources/Page/OCPDashboard/OCPDashboard.resource +Suite Setup Suite Setup +Suite Teardown Suite Teardown + + +*** Variables *** +${RHOAI_APPNAME} Red Hat OpenShift AI +${RHOAI_OPERATOR_NAME} Red Hat OpenShift AI +${KSERVE_APPNAME} Red Hat OpenShift Serverless +${KSERVE_OPERATOR_NAME} Red Hat OpenShift Serverless +${KNATIVESERVING_NS} knative-serving +${RHOAI_OPERATOR_NS} redhat-ods-operator + + +*** Test Cases *** +Validate DSC creates all Serverless CRs + [Documentation] The purpose of this Test Case is to validate the creation + ... of KServe Custom Resources + [Tags] Operator ODS-2600 + Check And Install Operator In Openshift ${RHOAI_APPNAME} ${RHOAI_OPERATOR_NAME} + Check And Install Operator In Openshift ${KSERVE_APPNAME} ${KSERVE_OPERATOR_NAME} + Is Resource Present KnativeServing knative-serving ${KNATIVESERVING_NS} + Check Status oc get KnativeServing knative-serving -n ${KNATIVESERVING_NS} -o json | jq '.status.conditions[] | select(.type=="Ready") | .status' KnativeServing "True" # robocop: disable + Is Resource Present Gateway knative-ingress-gateway ${KNATIVESERVING_NS} + Is Resource Present Gateway knative-local-gateway ${KNATIVESERVING_NS} + Is Resource Present Service knative-local-gateway istio-system + Is Resource Present deployment controller ${KNATIVESERVING_NS} + Check Pods Number ${KNATIVESERVING_NS} app.kubernetes.io/component=controller + ${pod_names}= Get Pod Names ${KNATIVESERVING_NS} app.kubernetes.io/component=controller + Verify Containers Have Zero Restarts ${pod_names} ${KNATIVESERVING_NS} + ${podname}= Get Pod Name ${RHOAI_OPERATOR_NS} label_selector=name=rhods-operator + Check For Errors On Operator Logs ${podname} ${RHOAI_OPERATOR_NS} + Check DSC Conditions ${KNATIVESERVING_NS} default-dsc + + +*** Keywords *** +Suite Setup + [Documentation] Suite Setup + Set Library Search Order SeleniumLibrary + RHOSi Setup + +Suite Teardown + [Documentation] Suite Teardown + Close All Browsers + RHOSi Teardown + +Is Resource Present + [Documentation] Check CR + [Arguments] ${resource} ${resource_name} ${namespace} + ${rc}= Run and Return Rc + ... oc get ${resource} ${resource_name} -n ${namespace} + Should Be Equal "${rc}" "0" msg=${resource} does not exist + +Check Status + [Documentation] Check Resource Status + [Arguments] ${oc_get} ${resource} ${expected_status} + ${status}= Run + ... ${oc_get} + Log ${status} console=True + Should Be Equal ${status} ${expected_status} msg=${resource} is not in Ready status + +Check Pods Number + [Documentation] Checks number of Pods + [Arguments] ${namespace} ${label_selector} + ${return_code} ${output} Run And Return Rc And Output oc get pod -n ${namespace} -l app.kubernetes.io/component=controller | tail -n +2 | wc -l # robocop: disable + Should Be Equal As Integers ${return_code} ${0} + Should Not Be Empty ${output} + Log To Console pods ${label_selector} created + +Check DSC Conditions + [Documentation] Checks that all conditions Reconciled Succesfully + [Arguments] ${namespace} ${dsc_name} + ${rc} ${out}= Run And Return Rc And Output + ... oc wait --timeout=3m --for jsonpath='{.status.conditions[].reason}'=ReconcileCompleted -n ${namespace} dsc ${dsc_name} # robocop: disable + Should Be Equal As Integers ${rc} ${0} + Log ${out} console=${out} + +Check For Errors On Operator Logs + [Documentation] Checks there are no errors on Operator Logs + [Arguments] ${operator_name} ${operator_namespace} + ${pod_logs}= Oc Get Pod Logs name=${operator_name} namespace=${operator_namespace} container=rhods-operator + ${error_present}= Run Keyword And Return Status Should Contain ${pod_logs} ERROR + IF ${error_present} + Log message=Check Pod Logs, ERROR level logs found. level=WARN + ELSE + Log message=No ERROR logs found on Pod. level=INFO + END + +Extract Errors From Logs + [Documentation] Given Pod Logs it retrieves only the ERROR level ones. + [Arguments] ${logs} + ${log_splits}= Split String string=${logs} separator=. + ${value}= Set Variable ${logs} + FOR ${idx} ${split} IN ENUMERATE @{log_splits} start=1 + Log ${idx} - ${split} + ${present}= Run Keyword And Return Status + ... Should Contain ${split} ERROR + IF ${present} + ${value}= Set Variable ${value["${split}"]} + Log message=No ERROR logs found on Pod. level=WARN + ELSE + ${value}= Set Variable ${EMPTY} + Log message=No ERROR logs found on Pod. level=INFO + BREAK + END + END diff --git a/ods_ci/tests/Tests/400__ods_dashboard/400__ods_dashboard.robot b/ods_ci/tests/Tests/400__ods_dashboard/400__ods_dashboard.robot index 2485fe624..a66fdbb74 100644 --- a/ods_ci/tests/Tests/400__ods_dashboard/400__ods_dashboard.robot +++ b/ods_ci/tests/Tests/400__ods_dashboard/400__ods_dashboard.robot @@ -231,7 +231,7 @@ Verify "Enabled" Keeps Being Available After One Of The ISV Operators If Uninsta ... ODS-1491 ... Tier1 ... ProductBug - Check And Install Operator in Openshift ${openvino_operator_name} ${openvino_appname} + Check And Install Operator In Openshift ${openvino_operator_name} ${openvino_appname} Close All Browsers Verify Operator Is Added On ODS Dashboard operator_name=${openvino_container_name} Uninstall Operator And Check Enabled Page Is Rendering operator_name=${openvino_operator_name} operator_appname=${openvino_appname} @@ -617,14 +617,14 @@ Uninstall Operator And Check Enabled Page Is Rendering Check And Uninstall Operator In Openshift [Documentation] it checks operator is uninstalled if not then uninstall it [Arguments] ${operator_name} ${operator_appname} ${dashboard_app_id} ${expected_number_operator}=2 - ${status} Check If Operator Is Already Installed In Opneshift ${operator_name} + ${status} Check If Operator Is Already Installed In Openshift ${operator_name} IF ${status} Open OperatorHub ${actual_no_of_operator} Get The Number of Operator Available ${operator_appname} IF ${actual_no_of_operator} == ${expected_number_operator} Uninstall Operator ${operator_name} ELSE - FAIL Only ${actual_no_of_operator} ${operator_name} is found in Opearatorhub + FAIL Only ${actual_no_of_operator} ${operator_name} is found in Operatorhub END END diff --git a/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot b/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot index 6e41fefce..2160527e0 100644 --- a/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot +++ b/ods_ci/tests/Tests/400__ods_dashboard/415__ods_dashboard_projects/415__ods_dashboard_projects_notebook_images.robot @@ -24,7 +24,7 @@ Verify User Can Create A Workbench Using Intel AiKit Image Set Test Variable ${IMG_NAME} oneAPI AI Analytics Toolkit Set Test Variable ${WORKBENCH_TITLE} aikitwb Set Test Variable ${PV_DESCRIPTION} PV for AiKit workbench - Check And Install Operator in Openshift ${INTEL_AIKIT_OPERATOR_NAME} ${INTEL_AIKIT_APPNAME} + Check And Install Operator In Openshift ${INTEL_AIKIT_OPERATOR_NAME} ${INTEL_AIKIT_APPNAME} Create Tabname Instance For Installed Operator ${INTEL_AIKIT_OPERATOR_NAME} ... AIKitContainer ${APPLICATIONS_NAMESPACE} Go To RHODS Dashboard diff --git a/ods_ci/tests/Tests/600__ai_apps/620__intel_aikit/620__intel_aikit.robot b/ods_ci/tests/Tests/600__ai_apps/620__intel_aikit/620__intel_aikit.robot index c333d0774..293de4321 100644 --- a/ods_ci/tests/Tests/600__ai_apps/620__intel_aikit/620__intel_aikit.robot +++ b/ods_ci/tests/Tests/600__ai_apps/620__intel_aikit/620__intel_aikit.robot @@ -35,7 +35,7 @@ Verify Intel AIKIT Operator Can Be Installed Using OpenShift Console [Documentation] This Test Case Installed Intel AIKIT operator in Openshift cluster ... Check and Launch AIKIT notebook image from RHODS dashboard ... ProductBug: RHODS-2748 - Check And Install Operator in Openshift ${intel_aikit_container_name} ${intel_aikit_appname} + Check And Install Operator In Openshift ${intel_aikit_container_name} ${intel_aikit_appname} Create Tabname Instance For Installed Operator ${intel_aikit_operator_name} AIKitContainer ${APPLICATIONS_NAMESPACE} Go To RHODS Dashboard Verify Service Is Enabled ${intel_aikit_container_name} diff --git a/ods_ci/tests/Tests/600__ai_apps/660__openvino/660__openvino.robot b/ods_ci/tests/Tests/600__ai_apps/660__openvino/660__openvino.robot index 6ba8cc5c8..7ee1bd41d 100644 --- a/ods_ci/tests/Tests/600__ai_apps/660__openvino/660__openvino.robot +++ b/ods_ci/tests/Tests/600__ai_apps/660__openvino/660__openvino.robot @@ -34,7 +34,7 @@ Verify Openvino Operator Can Be Installed Using OpenShift Console ... ODS-1085 [Documentation] This Test Case Installed Openvino operator in Openshift cluster ... and Check and Launch Openvino notebook image from RHODS dashboard - Check And Install Operator in Openshift ${openvino_operator_name} ${openvino_appname} + Check And Install Operator In Openshift ${openvino_operator_name} ${openvino_appname} Create Tabname Instance For Installed Operator ${openvino_operator_name} Notebook ${APPLICATIONS_NAMESPACE} Wait Until Keyword Succeeds 1200 1 Check Image Build Status Complete openvino-notebook Go To RHODS Dashboard diff --git a/ods_ci/tests/Tests/600__ai_apps/670__pachyderm/670__pachyderm.robot b/ods_ci/tests/Tests/600__ai_apps/670__pachyderm/670__pachyderm.robot index 879312de6..9a1f836bb 100644 --- a/ods_ci/tests/Tests/600__ai_apps/670__pachyderm/670__pachyderm.robot +++ b/ods_ci/tests/Tests/600__ai_apps/670__pachyderm/670__pachyderm.robot @@ -45,7 +45,7 @@ Pachyderm Suite Setup Open OCP Console Login to OCP Wait Until OpenShift Console Is Loaded - Check And Install Operator in Openshift ${pachyderm_container_name} ${pachyderm_appname} + Check And Install Operator In Openshift ${pachyderm_container_name} ${pachyderm_appname} Run oc new-project ${pachyderm_ns} Create Pachyderm AWS-Secret Create Tabname Instance For Installed Operator ${pachyderm_container_name} ${pachyderm_container_name} ${pachyderm_appname}