Skip to content

Commit

Permalink
Hotfix/validate service mesh control plane already created (red-hat-d…
Browse files Browse the repository at this point in the history
…ata-services#2024)

Fixed Validate Service Mesh Control Plane Already Created Test Case to
iterate on while loop until expected error message is printed on logs
with a 5 min timeout.
  • Loading branch information
asanzgom authored Nov 14, 2024
2 parents 7ee45a5 + 79c28aa commit a3240e7
Showing 1 changed file with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ ${INSTALL_TYPE} CLi
${TEST_ENV} PSI
${IS_PRESENT} 0
${IS_NOT_PRESENT} 1
${MSSG_REGEX} denied the request: only one service mesh may be installed per project/namespace
${MSG_REGEX} denied the request: only one service mesh may be installed per project/namespace


*** Test Cases ***
Validate Service Mesh Control Plane Already Created
[Documentation] This Test Case validates that only one ServiceMeshControlPlane is allowed to be installed per project/namespace
[Tags] RHOAIENG-2517
[Tags] RHOAIENG-2517 Operator
Fetch Image Url And Update Channel
Check Whether DSC Exists And Save Component Statuses
Fetch Cluster Type By Domain
Expand Down Expand Up @@ -142,17 +142,20 @@ Operator Deployment Should Be Ready
Verify Pod Logs Contain Error
[Documentation] Checks whether there is a SMCP related error on the Pod Logs
${pod_name}= Get Pod Name ${OPERATOR_NAMESPACE} ${OPERATOR_LABEL_SELECTOR}
${pod_logs}= Oc Get Pod Logs
... name=${pod_name}
... namespace=${OPERATOR_NAMESPACE}
... container=${OPERATOR_POD_CONTAINER_NAME}
${match_list}= Get Regexp Matches ${pod_logs} ${MSSG_REGEX}
${entry_msg}= Remove Duplicates ${match_list}
${length}= Get Length ${entry_msg}
IF ${length} == ${0}
FAIL Pod ${pod_name} logs should contain message ${MSSG_REGEX}.
ELSE
Log message=Pod ${pod_name} logs contain error message '${MSSG_REGEX}' level=INFO
${length}= Set Variable 0
TRY
WHILE ${length} == 0 limit=5m
${pod_logs}= Oc Get Pod Logs
... name=${pod_name}
... namespace=${OPERATOR_NAMESPACE}
... container=${OPERATOR_POD_CONTAINER_NAME}
${match_list}= Get Regexp Matches ${pod_logs} ${MSG_REGEX}
${entry_msg}= Remove Duplicates ${match_list}
${length}= Get Length ${entry_msg}
Sleep 10s
END
EXCEPT
Fail msg=Pod ${pod_name} logs should contain message '${MSG_REGEX}'
END

Cleanup Olm Install Dir
Expand Down

0 comments on commit a3240e7

Please sign in to comment.