Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHOAIENG-13014 - Rewrite Verify RHODS Operator Logs test #1822

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@ Suite Teardown RHOSi Teardown


*** Variables ***
${regex_pattern} level=([Ee]rror).*|([Ff]ailed) to list .*
${regex_pattern} level":"([Ee]rror).*|([Ff]ailed) to list .*


*** Test Cases ***
Verify RHODS Operator Logs
Verify RHODS Operator Logs After Restart
[Tags] Sanity
... ODS-1007
... Operator
Restart RHODS Operator Pod
#Get the POD name
${data} Run Keyword Oc Get kind=Pod namespace=${OPERATOR_NAMESPACE} label_selector=${OPERATOR_LABEL_SELECTOR}
#Capture the logs based on containers
${val} Run oc logs --tail=1000000 ${data[0]['metadata']['name']} -n ${OPERATOR_NAMESPACE} -c ${OPERATOR_POD_CONTAINER_NAME}
${val} Run oc logs --tail=-1 ${data[0]['metadata']['name']} -n ${OPERATOR_NAMESPACE} -c ${OPERATOR_POD_CONTAINER_NAME}
#To check if command has been successfully executed and the logs have been captured
IF len($val)==${0} FAIL Either OC command has not been executed successfully or Logs are not present
#Filter the error msg from the log captured
Expand All @@ -40,3 +41,10 @@ Verify RHODS Operator Logs
#Verify if captured logs has any error entry if yes fail the TC
IF ${length} != ${0} FAIL There are some error entry present in opeartor logs '${entry_msg}'
... ELSE Log Operator log looks clean


*** Keywords ***
Restart RHODS Operator Pod
[Documentation] Restart the operator Pod by deleting it and waiting for a new one to be Ready
Oc Delete kind=Pod namespace=${OPERATOR_NAMESPACE} label_selector=${OPERATOR_LABEL_SELECTOR}
Wait For Pods Status namespace=${OPERATOR_NAMESPACE} label_selector=${OPERATOR_LABEL_SELECTOR} timeout=120
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ Verify DSPO Logs Show Error Encountered When Parsing DSPA
TRY
WHILE not ${stopped} limit=${timeout}
Sleep 1s
${logs} = Run oc logs --tail=1000000 ${pod_name} -n ${APPLICATIONS_NAMESPACE}
${logs} = Run oc logs --tail=-1 ${pod_name} -n ${APPLICATIONS_NAMESPACE}
${stopped} = Set Variable If "Encountered error when parsing CR" in """${logs}""" True False
END
EXCEPT WHILE loop was aborted type=start
Expand Down
Loading