diff --git a/ods_ci/tests/Resources/OCP.resource b/ods_ci/tests/Resources/OCP.resource index f76f0d736..c5d40ff16 100644 --- a/ods_ci/tests/Resources/OCP.resource +++ b/ods_ci/tests/Resources/OCP.resource @@ -201,6 +201,31 @@ Wait Until CRD Exists Wait Until Keyword Succeeds 15 times 5s ... Oc Get kind=CustomResourceDefinition name=${crd_fullname} +Resource Should Exist + [Documentation] Check resource existson a namespace + [Arguments] ${resource} ${resource_name} ${namespace} + ${rc} ${out}= Run and Return Rc And Output + ... oc get ${resource} ${resource_name} -n ${namespace} + Should Be Equal "${rc}" "0" msg=${out} + +Resource Status Should Be + [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 + +Verify Pod Logs Do Not Contain + [Documentation] Checks there are no errors on Pod Logs + [Arguments] ${pod_name} ${pod_namespace} ${regex_pattern} ${container} + ${pod_logs}= Oc Get Pod Logs name=${pod_name} namespace=${pod_namespace} container=${container} + ${match_list} Get Regexp Matches ${pod_logs} ${regex_pattern} + ${entry_msg} Remove Duplicates ${match_list} + ${length} Get Length ${entry_msg} + IF ${length} != ${0} FAIL Pod ${pod_name} logs should not contain regexp ${regex_pattern}. Matching log entry: ${entry_msg} + ... ELSE Log message=Pod ${pod_name} logs does not contain regexp ${regex_pattern} level=INFO + Is Resource Present [Documentation] Check If Resource Is Present In Namespace [Arguments] ${resource} ${resource_name} ${namespace} ${expected_result} @@ -225,3 +250,4 @@ Delete Namespace From Openshift ${rc} ${output}= Run And Return Rc And Output oc delete project ${namespace} Should Be Equal "${rc}" "0" msg=${output} 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/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..cbf6580d4 --- /dev/null +++ b/ods_ci/tests/Tests/100__deploy/130__operators/140__serverless_operator/140__serverless_operator.robot @@ -0,0 +1,68 @@ +*** Settings *** +Documentation Test Cases to verify Serverless installation +Library Collections +Library SeleniumLibrary +Library OpenShiftLibrary +Resource ../../../../Resources/Page/OCPDashboard/OCPDashboard.resource +Resource ../../../../Resources/OCP.resource +Suite Setup Suite Setup +Suite Teardown Suite Teardown + + +*** Variables *** +${KNATIVESERVING_NS} knative-serving +${ISTIO_NS} istio-system +${regex_pattern} ERROR +${LABEL_SELECTOR} name=rhods-operator + +*** Test Cases *** +Validate DSC creates all Serverless CRs + [Documentation] The purpose of this Test Case is to validate the creation + ... of Serverless Custom Resources + ... ProductBug: RHOAIENG-4358 + [Tags] Operator ODS-2600 ProductBug + Assign Vars According To Product ${PRODUCT} + Resource Should Exist KnativeServing knative-serving ${KNATIVESERVING_NS} + Resource Status Should Be oc get KnativeServing knative-serving -n ${KNATIVESERVING_NS} -o json | jq '.status.conditions[] | select(.type=="Ready") | .status' KnativeServing "True" # robocop: disable + Resource Should Exist Gateway knative-ingress-gateway ${KNATIVESERVING_NS} + Resource Should Exist Gateway knative-local-gateway ${KNATIVESERVING_NS} + Resource Should Exist Service knative-local-gateway ${ISTIO_NS} + Resource Should Exist deployment controller ${KNATIVESERVING_NS} + Wait For Pods Numbers 2 namespace=${KNATIVESERVING_NS} + ... label_selector=app.kubernetes.io/component=controller timeout=120 + ${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 ${OPERATOR_NAMESPACE} ${LABEL_SELECTOR} + Verify Pod Logs Do Not Contain ${podname} ${OPERATOR_NAMESPACE} ${regex_pattern} rhods-operator + Wait For DSC Conditions Reconciled ${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 + +Assign Vars According To Product + [Documentation] Assign vars related to product + [Arguments] ${PRODUCT} + IF "${PRODUCT}" == "RHODS" + Set Suite Variable ${OPERATOR_APPNAME} Red Hat OpenShift AI + Set Suite Variable ${OPERATOR_NAME} Red Hat OpenShift AI + ELSE IF "${PRODUCT}" == "ODH" + Set Suite Variable ${OPERATOR_APPNAME} Open Data Hub Operator + Set Suite Variable ${OPERATOR_NAME} Open Data Hub Operator + END + +Wait For DSC Conditions Reconciled + [Documentation] Checks all DSC conditions to be successfully reconciled + [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} 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 c6d2aa841..8d7b3c648 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 @@ -640,7 +640,7 @@ Check And Uninstall Operator In Openshift 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