Skip to content

Commit

Permalink
Adapt Trusted CA bundles tests to ODH (#1380)
Browse files Browse the repository at this point in the history
* Adapt Trusted CA bundles tests to ODH

* Moved Assign Vars According to Product to RHOSi.resource

* remove  as input param

* removed trailing whitespace

* removed Assign Vars According To Product invokation
  • Loading branch information
asanzgom authored Apr 16, 2024
1 parent b66122d commit 24f666c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 17 deletions.
1 change: 0 additions & 1 deletion ods_ci/tests/Resources/OCP.resource
Original file line number Diff line number Diff line change
Expand Up @@ -250,4 +250,3 @@ Delete Namespace From Openshift
${rc} ${output}= Run And Return Rc And Output oc delete project ${namespace}
Should Be Equal "${rc}" "0" msg=${output}
END

15 changes: 15 additions & 0 deletions ods_ci/tests/Resources/RHOSi.resource
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Protect Sensitive Variables In Keywords
Initialize Global Variables
[Documentation] Sets global variables
[Arguments] ${force_fetch}=False
Assign Vars According To Product
${RHODS_VERSION}= Get RHODS Version ${force_fetch}
Set Global Variable ${RHODS_VERSION}
Set Prometheus Variables
Expand All @@ -82,3 +83,17 @@ Required Global Variables Should Exist
Variable Should Exist ${MONITORING_NAMESPACE}
Variable Should Exist ${OPERATOR_NAMESPACE}
Variable Should Exist ${NOTEBOOKS_NAMESPACE}

Assign Vars According To Product
[Documentation] Assign vars related to product
IF "${PRODUCT}" == "RHODS"
Set Suite Variable ${OPERATOR_APPNAME} Red Hat OpenShift AI
Set Suite Variable ${OPERATOR_NAME} Red Hat OpenShift AI
Set Suite Variable ${OPERATOR_DEPLOYMENT_NAME} rhods-operator
Set Suite Variable ${OPERATOR_LABEL_SELECTOR} name=rhods-operator
ELSE IF "${PRODUCT}" == "ODH"
Set Suite Variable ${OPERATOR_APPNAME} Open Data Hub Operator
Set Suite Variable ${OPERATOR_NAME} Open Data Hub Operator
Set Suite Variable ${OPERATOR_DEPLOYMENT_NAME} opendatahub-operator-controller-manager
Set Suite Variable ${OPERATOR_LABEL_SELECTOR} control-plane=controller-manager
END
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Documentation Test Cases to verify Trusted CA Bundle support
Library Collections
Resource ../../../../Resources/OCP.resource
Resource ../../../../Resources/ODS.robot
Resource ../../../../Resources/RHOSi.resource
Suite Setup Suite Setup
Suite Teardown Suite Teardown


*** Variables ***
${OPERATOR_NS} ${OPERATOR_NAMESPACE}
${RHOAI_OPERATOR_DEPLOYMENT_NAME} rhods-operator
${TEST_NS} test-trustedcabundle
${DSCI_NAME} default-dsci
${TRUSTED_CA_BUNDLE_CONFIGMAP} odh-trusted-ca-bundle
Expand Down Expand Up @@ -74,7 +74,7 @@ Validate Trusted CA Bundles State Removed
Suite Setup
[Documentation] Suite Setup
RHOSi Setup
Wait Until Operator Ready ${RHOAI_OPERATOR_DEPLOYMENT_NAME} ${OPERATOR_NS}
Wait Until Operator Ready ${OPERATOR_DEPLOYMENT_NAME} ${OPERATOR_NS}
Wait For DSCI Ready State ${DSCI_NAME} ${OPERATOR_NS}
Create Namespace In Openshift ${TEST_NS}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Library SeleniumLibrary
Library OpenShiftLibrary
Resource ../../../../Resources/Page/OCPDashboard/OCPDashboard.resource
Resource ../../../../Resources/OCP.resource
Resource ../../../../Resources/RHOSi.resource
Suite Setup Suite Setup
Suite Teardown Suite Teardown

Expand All @@ -13,15 +14,14 @@ Suite Teardown Suite Teardown
${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}
Expand All @@ -32,7 +32,7 @@ Validate DSC creates all Serverless CRs
... 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}
${podname}= Get Pod Name ${OPERATOR_NAMESPACE} ${OPERATOR_LABEL_SELECTOR}
Verify Pod Logs Do Not Contain ${podname} ${OPERATOR_NAMESPACE} ${regex_pattern} rhods-operator
Wait For DSC Conditions Reconciled ${KNATIVESERVING_NS} default-dsc

Expand All @@ -48,17 +48,6 @@ 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}
Expand Down

0 comments on commit 24f666c

Please sign in to comment.