Skip to content

Commit

Permalink
RHOAIENG-2508 ODS-2600 Validate DSC creates all Serverless CRs
Browse files Browse the repository at this point in the history
  • Loading branch information
asanzgom committed Mar 6, 2024
1 parent dd50929 commit e15eb4d
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

0 comments on commit e15eb4d

Please sign in to comment.