-
Notifications
You must be signed in to change notification settings - Fork 230
USHIFT-6744: Add sosreport and kcm related tests from OTP #6631
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
Open
kasturinarra
wants to merge
1
commit into
openshift:main
Choose a base branch
from
kasturinarra:port_wldsc_rf
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+231
−1
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,178 @@ | ||
| *** Settings *** | ||
| Documentation Tests verifying MicroShift SOS report plugins are listed and enabled, | ||
| ... SOS report collects MicroShift config and OVN related information, | ||
| ... and greenboot logs reside in a separate directory. | ||
| ... | ||
| ... Ported from openshift-tests-private: | ||
| ... Critical-60924, Critical-60929, High-68257, High-60930, High-68256 | ||
|
|
||
| Resource ../../resources/microshift-host.resource | ||
| Resource ../../resources/microshift-process.resource | ||
| Resource ../../resources/common.resource | ||
|
|
||
| Suite Setup Setup | ||
| Suite Teardown Teardown | ||
|
|
||
| Test Tags slow | ||
|
|
||
|
|
||
| *** Variables *** | ||
| ${SOS_REPORT_BASE_DIR} /tmp/rf-test/sos-report-plugins | ||
|
|
||
|
|
||
| *** Test Cases *** | ||
| Verify SOS Report Lists Enabled MicroShift Plugins | ||
| [Documentation] Verify sos report -l lists both microshift and | ||
| ... microshift_ovn plugins and they are enabled. | ||
| ... OCP-60924 | ||
| ${output}= Command Should Work sos report -l | ||
| Should Contain ${output} microshift | ||
| Should Contain ${output} microshift_ovn | ||
| Plugin Should Be Enabled ${output} microshift | ||
| Plugin Should Be Enabled ${output} microshift_ovn | ||
|
|
||
| Verify SOS Report Collects MicroShift And OVN Information | ||
| [Documentation] Verify running sos report with microshift profile | ||
| ... collects microshift config, oc adm inspect output, | ||
| ... and OVN related information. | ||
| ... OCP-60929, OCP-68257 | ||
| ${sos_report_tarfile}= Create Sos Report | ||
| ${sos_report_extracted}= Extract Sos Report ${sos_report_tarfile} | ||
|
|
||
| ${sos_text}= Command Should Work cat ${sos_report_extracted}/sos_reports/sos.txt | ||
| Should Contain ${sos_text} oc adm inspect | ||
| Should Contain ${sos_text} ovs-appctl -t /var/run/ovn/ovn-controller.*.ctl ct-zone-list | ||
|
|
||
| Verify Remote Directory Exists With Sudo ${sos_report_extracted}/etc/microshift | ||
| Verify Remote Directory Exists With Sudo ${sos_report_extracted}/etc/microshift/manifests | ||
| Verify Remote Directory Exists With Sudo ${sos_report_extracted}/etc/microshift/manifests.d | ||
|
|
||
| ${system_config}= Command Should Work | ||
| ... ls -l /etc/microshift | awk '{print $NF}' | tail -n+2 | ||
| ${report_config}= Command Should Work | ||
| ... ls -l ${sos_report_extracted}/etc/microshift | awk '{print $NF}' | tail -n+2 | ||
| Should Be Equal As Strings ${report_config} ${system_config} | ||
| ... msg=Not all microshift config files are collected in sosreport | ||
|
|
||
| ${system_manifests}= Command Should Work ls -l /etc/microshift/manifests | ||
| ${report_manifests}= Command Should Work | ||
| ... ls -l ${sos_report_extracted}/etc/microshift/manifests | ||
| Should Be Equal As Strings ${report_manifests} ${system_manifests} | ||
| ... msg=Files inside /etc/microshift/manifests directory does not match between system and sosreport | ||
|
|
||
| ${system_manifests_d}= Command Should Work ls -l /etc/microshift/manifests.d/ | ||
| ${report_manifests_d}= Command Should Work | ||
| ... ls -l ${sos_report_extracted}/etc/microshift/manifests.d/ | ||
| Should Be Equal As Strings ${report_manifests_d} ${system_manifests_d} | ||
| ... msg=Files inside /etc/microshift/manifests.d directory does not match between system and sosreport | ||
|
|
||
| Verify SOS Report Collects Data When MicroShift Is Stopped | ||
| [Documentation] Verify that sos report -p microshift still collects | ||
| ... config files, journal logs, and OVN data when MicroShift | ||
| ... service is stopped, but does not collect oc adm inspect data. | ||
| [Tags] restart | ||
|
|
||
| Stop MicroShift | ||
|
|
||
| ${rand_str}= Generate Random String 4 [NUMBERS] | ||
| ${sos_report_dir}= Catenate SEPARATOR=${EMPTY} ${SOS_REPORT_BASE_DIR}_ ${rand_str} | ||
| Command Should Work mkdir -p ${sos_report_dir} | ||
| Command Should Work | ||
| ... sos report --batch --tmp-dir ${sos_report_dir} -p microshift | ||
| ${sos_report_tarfile}= Command Should Work | ||
| ... find ${sos_report_dir} -type f -name "sosreport-*.tar.xz" | ||
| Should Not Be Empty ${sos_report_tarfile} | ||
| ${sos_report_extracted}= Extract Sos Report ${sos_report_tarfile} | ||
|
|
||
| ${sos_text}= Command Should Work cat ${sos_report_extracted}/sos_reports/sos.txt | ||
| Should Not Contain ${sos_text} oc adm inspect | ||
|
|
||
| Verify Remote Directory Exists With Sudo ${sos_report_extracted}/etc/microshift | ||
| Verify Remote Directory Exists With Sudo ${sos_report_extracted}/etc/microshift/manifests | ||
| Verify Remote Directory Exists With Sudo ${sos_report_extracted}/etc/microshift/manifests.d | ||
| Verify Remote Directory Exists With Sudo ${sos_report_extracted}/sos_commands/microshift | ||
| Verify Remote Directory Exists With Sudo ${sos_report_extracted}/sos_commands/microshift_ovn | ||
|
|
||
| ${microshift_cmds}= Command Should Work | ||
| ... ls ${sos_report_extracted}/sos_commands/microshift | ||
| Should Contain ${microshift_cmds} journalctl_--no-pager_--unit_microshift | ||
| Should Contain ${microshift_cmds} journalctl_--no-pager_--unit_microshift-etcd.scope | ||
| Should Contain ${microshift_cmds} microshift_version | ||
| Should Contain ${microshift_cmds} systemctl_status_microshift | ||
|
|
||
| [Teardown] Start MicroShift | ||
|
|
||
| Verify Greenboot Logs In SOS Report | ||
| [Documentation] Verify greenboot logs reside in a separate directory | ||
| ... and are easy to access in the SOS report. | ||
| ... OCP-68256 | ||
| ${sos_report_tarfile}= Create Sos Report With Profile system | ||
| ${sos_report_extracted}= Extract Sos Report ${sos_report_tarfile} | ||
|
|
||
| ${greenboot_files}= Command Should Work | ||
| ... ls -l ${sos_report_extracted}/sos_commands/greenboot | ||
| Should Contain ${greenboot_files} journalctl_--no-pager_--unit_greenboot-healthcheck | ||
| Should Contain ${greenboot_files} systemctl_status_greenboot-healthcheck | ||
|
|
||
| ${greenboot_conf}= Command Should Work | ||
| ... ls -l ${sos_report_extracted}/etc/greenboot | ||
| Should Contain ${greenboot_conf} greenboot.conf | ||
|
|
||
|
|
||
| *** Keywords *** | ||
| Setup | ||
| [Documentation] Set up all of the tests in this suite | ||
| Check Required Env Variables | ||
| Login MicroShift Host | ||
|
|
||
| Teardown | ||
| [Documentation] Test suite teardown | ||
| Cleanup Sos Report Directory | ||
| Logout MicroShift Host | ||
|
|
||
| Plugin Should Be Enabled | ||
| [Documentation] Verify that the named plugin is not disabled in the sos report -l output. | ||
| [Arguments] ${output} ${plugin_name} | ||
| Should Not Match Regexp ${output} ${plugin_name}\\s+.*disabled | ||
|
|
||
| Create Sos Report | ||
| [Documentation] Create a MicroShift SOS Report using microshift-sos-report | ||
| ... and return the tar file path. | ||
| ${rand_str}= Generate Random String 4 [NUMBERS] | ||
| ${sos_report_dir}= Catenate SEPARATOR=${EMPTY} ${SOS_REPORT_BASE_DIR}_ ${rand_str} | ||
| Command Should Work mkdir -p ${sos_report_dir} | ||
| ${output}= Command Should Work | ||
| ... /usr/bin/microshift-sos-report --tmp-dir ${sos_report_dir} | ||
| Should Contain ${output} Your sos report has been generated and saved in | ||
| ${sos_report_tarfile}= Command Should Work | ||
| ... find ${sos_report_dir} -type f -name "sosreport-*.tar.xz" | ||
| Should Not Be Empty ${sos_report_tarfile} | ||
| RETURN ${sos_report_tarfile} | ||
|
|
||
| Create Sos Report With Profile | ||
| [Documentation] Create a SOS report with the specified profile and return the tar file path. | ||
| [Arguments] ${profile} | ||
| ${rand_str}= Generate Random String 4 [NUMBERS] | ||
| ${sos_report_dir}= Catenate SEPARATOR=${EMPTY} ${SOS_REPORT_BASE_DIR}_ ${rand_str} | ||
| Command Should Work mkdir -p ${sos_report_dir} | ||
| Command Should Work | ||
| ... sos report --batch --clean --all-logs --profile ${profile} --tmp-dir ${sos_report_dir} | ||
| ${sos_report_tarfile}= Command Should Work | ||
| ... find ${sos_report_dir} -type f -name "sosreport-*.tar.xz" | ||
| Should Not Be Empty ${sos_report_tarfile} | ||
| RETURN ${sos_report_tarfile} | ||
|
|
||
| Extract Sos Report | ||
| [Documentation] Extract SOS report from the tar file and return the extracted directory. | ||
| [Arguments] ${sos_report_tarfile} | ||
| ${sos_report_dir}= Command Should Work dirname ${sos_report_tarfile} | ||
| Command Should Work tar xf ${sos_report_tarfile} -C ${sos_report_dir} | ||
| ${sos_report_untared}= Command Should Work | ||
| ... find ${sos_report_dir} -maxdepth 1 -type d -name "sosreport-*" | ||
| Should Not Be Empty ${sos_report_untared} | ||
| RETURN ${sos_report_untared} | ||
|
|
||
| Cleanup Sos Report Directory | ||
| [Documentation] Remove temporary SOS report files created during tests. | ||
| Command Should Work rm -rf ${SOS_REPORT_BASE_DIR}_* | ||
| Command Should Work rm -rf /var/tmp/sosreport-* |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why you only add it in scenarios?
I think this should be add it in all the scenario where
suites/osconfig/clusterid.robotis.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason i did not add is, in general we are running these gingko cases only in release scenarios right, so i thought adding there alone would be more appropriate than expanding it to other scenarios