|
| 1 | +*** Settings *** |
| 2 | +Documentation Test Cases to verify DSC/DSCi negative cases when dependant (servicemesh, serverless) operators are not installed |
| 3 | +
|
| 4 | +Library Collections |
| 5 | +Library OperatingSystem |
| 6 | +Resource ../../../../Resources/OCP.resource |
| 7 | +Resource ../../../../Resources/ODS.robot |
| 8 | +Resource ../../../../Resources/RHOSi.resource |
| 9 | +Resource ../../../../Resources/ServiceMesh.resource |
| 10 | +Resource ../../../../Resources/Page/OCPDashboard/InstalledOperators/InstalledOperators.robot |
| 11 | +Resource ../../../../Resources/Page/OCPDashboard/OperatorHub/InstallODH.robot |
| 12 | +Resource ../../../../../tasks/Resources/RHODS_OLM/uninstall/uninstall.robot |
| 13 | +Resource ../../../../../tasks/Resources/RHODS_OLM/install/oc_install.robot |
| 14 | +Suite Setup Suite Setup |
| 15 | +Suite Teardown Suite Teardown |
| 16 | + |
| 17 | + |
| 18 | +*** Variables *** |
| 19 | +${OPERATOR_NS} ${OPERATOR_NAMESPACE} |
| 20 | +${DSCI_NAME} default-dsci |
| 21 | +${SERVICE_MESH_OPERATOR_NS} openshift-operators |
| 22 | +${SERVICE_MESH_CR_NS} istio-system |
| 23 | +${SERVICE_MESH_CR_NAME} data-science-smcp |
| 24 | +${IS_NOT_PRESENT} 1 |
| 25 | + |
| 26 | + |
| 27 | +*** Test Cases *** |
| 28 | +Validate DSC and DSCI Created With Errors When Service Mesh Operator Is Not Installed #robocop:disable |
| 29 | + [Documentation] The purpose of this Test Case is to validate that DSC and DSCI are created |
| 30 | + ... without Service Mesh Operator installer, but with errors |
| 31 | + [Tags] Operator Tier3 ODS-2584 RHOAIENG-2514 |
| 32 | +
|
| 33 | + Remove DSC And DSCI Resources |
| 34 | + Uninstall Service Mesh Operator CLI |
| 35 | + |
| 36 | + Log To Console message=Creating DSCInitialization CR via CLI |
| 37 | + Apply DSCInitialization CustomResource dsci_name=${DSCI_NAME} |
| 38 | + Log To Console message=Checking DSCInitialization conditions |
| 39 | + Wait Until Keyword Succeeds 6 min 0 sec |
| 40 | + ... DSCInitialization Should Fail Because Service Mesh Operator Is Not Installed |
| 41 | + |
| 42 | + Log To Console message=Creating DataScienceCluster CR via CLI |
| 43 | + Apply DataScienceCluster CustomResource dsc_name=${DSC_NAME} |
| 44 | + Log To Console message=Checking DataScienceCluster conditions |
| 45 | + Wait Until Keyword Succeeds 6 min 0 sec |
| 46 | + ... DataScienceCluster Should Fail Because Service Mesh Operator Is Not Installed |
| 47 | + |
| 48 | + [Teardown] Reinstall Service Mesh Operator And Recreate DSC And DSCI |
| 49 | + |
| 50 | +Validate DSC and DSCI Created With Errors When Service Mesh And Serverless Operators Are Not Installed #robocop:disable |
| 51 | + [Documentation] The purpose of this Test Case is to validate that DSC and DSCI are created |
| 52 | + ... without dependant operators ((servicemesh, serverless) installed, but with errors |
| 53 | + [Tags] Operator Tier3 ODS-2527 RHOAIENG-2518 |
| 54 | +
|
| 55 | + Remove DSC And DSCI Resources |
| 56 | + Uninstall Service Mesh Operator CLI |
| 57 | + Uninstall Serverless Operator CLI |
| 58 | + |
| 59 | + Log To Console message=Creating DSCInitialization CR via CLI |
| 60 | + Apply DSCInitialization CustomResource dsci_name=${DSCI_NAME} |
| 61 | + Sleep 45s reason=wait for 45 seconds until DSCI is created and reconciled |
| 62 | + |
| 63 | + Log To Console message=Creating DataScienceCluster CR via CLI |
| 64 | + Apply DataScienceCluster CustomResource dsc_name=${DSC_NAME} |
| 65 | + Log To Console message=Checking DataScienceCluster conditions |
| 66 | + Wait Until Keyword Succeeds 6 min 0 sec |
| 67 | + ... DataScienceCluster Should Fail Because Service Mesh And Serverless Operators Are Not Installed |
| 68 | + |
| 69 | + [Teardown] Reinstall Service Mesh And Serverless Operators And Recreate DSC And DSCI |
| 70 | + |
| 71 | +Validate DSC and DSCI Created With No Errors When Kserve Serving Is Unmanaged And Service Mesh And Serverless Operators Are Not Installed #robocop:disable |
| 72 | + [Documentation] The purpose of this Test Case is to validate that DSC and DSCI are created |
| 73 | + ... without dependant operators ((servicemesh, serverless) installed and with no errors |
| 74 | + ... because the Kserve component serving is unmanaged |
| 75 | + [Tags] Operator Tier3 RHOAIENG-3472 |
| 76 | +
|
| 77 | + Remove DSC And DSCI Resources |
| 78 | + Uninstall Service Mesh Operator CLI |
| 79 | + Uninstall Serverless Operator CLI |
| 80 | + |
| 81 | + Log To Console message=Creating DSCInitialization CR via CLI |
| 82 | + Apply DSCInitialization CustomResource dsci_name=${DSCI_NAME} |
| 83 | + Set Service Mesh Management State Unmanaged ${OPERATOR_NS} |
| 84 | + |
| 85 | + Wait For DSCInitialization CustomResource To Be Ready timeout=600 |
| 86 | + |
| 87 | + Log To Console message=Creating DataScienceCluster CR via CLI |
| 88 | + Apply DataScienceCluster CustomResource dsc_name=${DSC_NAME} |
| 89 | + |
| 90 | + Set DataScienceCluster Kserve Serving Management State ${DSC_NAME} Unmanaged |
| 91 | + |
| 92 | + Wait For DataScienceCluster CustomResource To Be Ready timeout=600 |
| 93 | + |
| 94 | + [Teardown] Reinstall Service Mesh And Serverless Operators And Recreate DSC And DSCI |
| 95 | + |
| 96 | + |
| 97 | +*** Keywords *** |
| 98 | +Suite Setup |
| 99 | + [Documentation] Suite Setup |
| 100 | + Set Library Search Order SeleniumLibrary |
| 101 | + |
| 102 | +Suite Teardown |
| 103 | + [Documentation] Suite Teardown |
| 104 | + Selenium Library.Close All Browsers |
| 105 | + RHOSi Teardown |
| 106 | + |
| 107 | +Set DataScienceCluster Kserve Serving Management State |
| 108 | + [Documentation] Sets DSC Kserve Serving mgmt state to a specific value |
| 109 | + [Arguments] ${dsc_name} ${status} |
| 110 | + ${result} = Run Process oc patch DataScienceCluster ${dsc_name} --type 'json' -p '[{"op" : "replace" ,"path" : "/spec/components/kserve/serving/managementState" ,"value" : "${status}"}]' #robocop:disable |
| 111 | + ... shell=true stderr=STDOUT |
| 112 | + IF $result.rc != 0 |
| 113 | + FAIL Can not patch serving.managementState field: ${result.stdout} |
| 114 | + END |
| 115 | + |
| 116 | +Reinstall Service Mesh Operator And Recreate DSC And DSCI |
| 117 | + [Documentation] Reinstalls Service Mesh operator and waits for the Service Mesh Control plane to be created |
| 118 | + Remove DSC And DSCI Resources |
| 119 | + Install Service Mesh Operator Via Cli |
| 120 | + Apply DSCInitialization CustomResource dsci_name=${DSCI_NAME} |
| 121 | + Wait For DSCInitialization CustomResource To Be Ready timeout=180 |
| 122 | + Apply DataScienceCluster CustomResource dsc_name=${DSC_NAME} |
| 123 | + Wait For DataScienceCluster CustomResource To Be Ready timeout=600 |
| 124 | + Set Service Mesh State To Managed And Wait For CR Ready |
| 125 | + ... ${SERVICE_MESH_CR_NAME} ${SERVICE_MESH_CR_NS} ${SERVICE_MESH_OPERATOR_NS} |
| 126 | + |
| 127 | +Reinstall Service Mesh And Serverless Operators And Recreate DSC And DSCI |
| 128 | + [Documentation] Reinstalls Dependant (service mesh, serverless) operators and waits for the Service Mesh Control plane to be created |
| 129 | + Remove DSC And DSCI Resources |
| 130 | + Install Serverless Operator Via Cli |
| 131 | + Install Service Mesh Operator Via Cli |
| 132 | + Apply DSCInitialization CustomResource dsci_name=${DSCI_NAME} |
| 133 | + Wait For DSCInitialization CustomResource To Be Ready timeout=180 |
| 134 | + Apply DataScienceCluster CustomResource dsc_name=${DSC_NAME} |
| 135 | + Wait For DataScienceCluster CustomResource To Be Ready timeout=600 |
| 136 | + Set Service Mesh State To Managed And Wait For CR Ready |
| 137 | + ... ${SERVICE_MESH_CR_NAME} ${SERVICE_MESH_CR_NS} ${SERVICE_MESH_OPERATOR_NS} |
| 138 | + |
| 139 | +Remove DSC And DSCI Resources |
| 140 | + [Documentation] Removed DSC and DSCI CRs resources from the cluster |
| 141 | + Log To Console message=Deleting DataScienceCluster CR From Cluster |
| 142 | + ${return_code} ${output}= Run And Return Rc And Output |
| 143 | + ... oc delete DataScienceCluster --all --ignore-not-found |
| 144 | + Should Be Equal As Integers ${return_code} 0 msg=Error deleting DataScienceCluster CR |
| 145 | + |
| 146 | + Wait Until Keyword Succeeds 3 min 0 sec |
| 147 | + ... Is Resource Present DataScienceCluster ${DSC_NAME} |
| 148 | + ... ${OPERATOR_NS} ${IS_NOT_PRESENT} |
| 149 | + |
| 150 | + Log To Console message=Deleting DSCInitialization CR From Cluster |
| 151 | + ${return_code} ${output}= Run And Return Rc And Output |
| 152 | + ... oc delete DSCInitialization --all --ignore-not-found |
| 153 | + Should Be Equal As Integers ${return_code} 0 msg=Error deleting DSCInitialization CR |
| 154 | + |
| 155 | + Wait Until Keyword Succeeds 3 min 0 sec |
| 156 | + ... Is Resource Present DSCInitialization ${DSCI_NAME} |
| 157 | + ... ${OPERATOR_NS} ${IS_NOT_PRESENT} |
| 158 | + |
| 159 | +DataScienceCluster Should Fail Because Service Mesh And Serverless Operators Are Not Installed |
| 160 | + [Documentation] Keyword to check the DSC conditions when dependant (servicemesh, serverless) operators are not installed. |
| 161 | + ... Two conditions, one per operator, should appear saying this operator is needed to enable kserve component. |
| 162 | + ${return_code} ${output}= Run And Return Rc And Output |
| 163 | + ... oc get DataScienceCluster ${DSC_NAME} -n ${OPERATOR_NS} -o json | jq -r '.status.conditions | map(.message) | join(",")' #robocop:disable |
| 164 | + Should Be Equal As Integers ${return_code} 0 msg=Error retrieved DSC conditions |
| 165 | + Should Contain ${output} operator servicemeshoperator not found. Please install the operator before enabling kserve component #robocop:disable |
| 166 | + Should Contain ${output} operator serverless-operator not found. Please install the operator before enabling kserve component #robocop:disable |
| 167 | + |
| 168 | +DSCInitialization Should Fail Because Service Mesh Operator Is Not Installed |
| 169 | + [Documentation] Keyword to check the DSCI conditions when service mesh operator is not installed. |
| 170 | + ... One condition should appear saying this operator is needed to enable kserve component. |
| 171 | + ${return_code} ${output}= Run And Return Rc And Output |
| 172 | + ... oc get DSCInitialization ${DSCI_NAME} -n ${OPERATOR_NS} -o json | jq -r '.status.conditions | map(.message) | join(",")' #robocop:disable |
| 173 | + Should Be Equal As Integers ${return_code} 0 msg=Error retrieved DSCI conditions |
| 174 | + Should Contain ${output} failed to find the pre-requisite Service Mesh Operator subscription, please ensure Service Mesh Operator is installed. failed to find the pre-requisite operator subscription \"servicemeshoperator\", please ensure operator is installed. missing operator \"servicemeshoperator\" #robocop:disable |
| 175 | + |
| 176 | +DataScienceCluster Should Fail Because Service Mesh Operator Is Not Installed |
| 177 | + [Documentation] Keyword to check the DSC conditions when service mesh operator is not installed. |
| 178 | + ... One condition should appear saying this operator is needed to enable kserve component. |
| 179 | + ${return_code} ${output}= Run And Return Rc And Output |
| 180 | + ... oc get DataScienceCluster ${DSC_NAME} -n ${OPERATOR_NS} -o json | jq -r '.status.conditions | map(.message) | join(",")' #robocop:disable |
| 181 | + Should Be Equal As Integers ${return_code} 0 msg=Error retrieved DSC conditions |
| 182 | + Should Contain ${output} Component reconciliation failed: 1 error occurred:\n\t* operator servicemeshoperator not found. Please install the operator before enabling kserve component #robocop:disable |
| 183 | + |
| 184 | + ${rc} ${logs}= Run And Return Rc And Output |
| 185 | + ... oc logs -l name=rhods-operator -c rhods-operator -n ${OPERATOR_NS} --ignore-errors |
| 186 | + |
| 187 | + Should Contain ${logs} failed to find the pre-requisite Service Mesh Operator subscription, please ensure Service Mesh Operator is installed. #robocop:disable |
0 commit comments