Skip to content

Commit

Permalink
fix: relocate must gather test suite after upgrade tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CFSNM committed Aug 12, 2024
1 parent 8667184 commit 9478b82
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 26 deletions.
31 changes: 31 additions & 0 deletions ods_ci/tests/Resources/CLI/MustGather/MustGather.resource
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# robocop: off=wrong-case-in-keyword-name,unnecessary-string-conversion,hyphen-in-variable-name
*** Settings ***
Documentation Tests the must-gather image for ODH/RHOAI
Library Process
Library OperatingSystem
Resource ../../Common.robot


*** Keywords ***
Get must-gather Logs
[Documentation] Runs the must-gather image and obtains the ODH/RHOAI logs
${output}= Run process tests/Resources/CLI/MustGather/get-must-gather-logs.sh shell=yes
Should Not Contain ${output.stdout} FAIL
${must-gather-dir}= Run ls -d must-gather.local.*
${namespaces-log-dir}= Run ls -d ${must-gather-dir}/quay-io-modh-must-gather-sha256-*/namespaces
Set Suite Variable ${must-gather-dir}
Set Suite Variable ${namespaces-log-dir}
Directory Should Exist ${must-gather-dir}
Directory Should Not Be Empty ${must-gather-dir}

Verify Logs For ${namespace}
[Documentation] Verifies the must-gather logs related to a namespace
Directory Should Exist ${namespaces-log-dir}/${namespace}
Directory Should Not Be Empty ${namespaces-log-dir}/${namespace}
Directory Should Not Be Empty ${namespaces-log-dir}/${namespace}/pods
${log-files}= Run find ${namespaces-log-dir}/${namespace}/pods -type f -name "*.log"
Should Not Be Equal ${log-files} ${EMPTY}

Cleanup must-gather Logs
[Documentation] Deletes the folder with the must-gather logs
Remove Directory ${must-gather-dir} recursive=True
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Documentation Tests the must-gather image for ODH/RHOAI
Library Process
Library OperatingSystem
Resource ../../../Resources/Common.robot
Resource ../../../Resources/CLI/MustGather/MustGather.resource


*** Test Cases ***
Expand All @@ -13,36 +14,10 @@ Verify that the must-gather image provides RHODS logs and info
... Tier1
... ODS-505
... Operator
... Upgrade
Get must-gather Logs
Verify logs for ${APPLICATIONS_NAMESPACE}
IF "${PRODUCT}" == "RHODS"
Verify Logs For ${OPERATOR_NAMESPACE}
Run Keyword If RHODS Is Managed Verify logs for ${MONITORING_NAMESPACE}
END
[Teardown] Cleanup must-gather Logs


*** Keywords ***
Get must-gather Logs
[Documentation] Runs the must-gather image and obtains the ODH/RHOAI logs
${output}= Run process tests/Tests/0100__platform/0103__must_gather/get-must-gather-logs.sh shell=yes
Should Not Contain ${output.stdout} FAIL
${must-gather-dir}= Run ls -d must-gather.local.*
${namespaces-log-dir}= Run ls -d ${must-gather-dir}/quay-io-modh-must-gather-sha256-*/namespaces
Set Suite Variable ${must-gather-dir}
Set Suite Variable ${namespaces-log-dir}
Directory Should Exist ${must-gather-dir}
Directory Should Not Be Empty ${must-gather-dir}

Verify Logs For ${namespace}
[Documentation] Verifies the must-gather logs related to a namespace
Directory Should Exist ${namespaces-log-dir}/${namespace}
Directory Should Not Be Empty ${namespaces-log-dir}/${namespace}
Directory Should Not Be Empty ${namespaces-log-dir}/${namespace}/pods
${log-files}= Run find ${namespaces-log-dir}/${namespace}/pods -type f -name "*.log"
Should Not Be Equal ${log-files} ${EMPTY}

Cleanup must-gather Logs
[Documentation] Deletes the folder with the must-gather logs
Remove Directory ${must-gather-dir} recursive=True
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Resource ../../Resources/Page/OCPDashboard/Builds/Builds.robot
Resource ../../Resources/Page/HybridCloudConsole/OCM.robot
Resource ../../Resources/Page/DistributedWorkloads/DistributedWorkloads.resource
Resource ../../Resources/Page/DistributedWorkloads/WorkloadMetricsUI.resource
Resource ../../Resources/CLI/MustGather/MustGather.resource

*** Variables ***
${S_SIZE} 25
Expand Down Expand Up @@ -197,6 +198,17 @@ Run Training Operator ODH Run Sleep PyTorchJob Test Use Case
Run Training Operator ODH Upgrade Test TestVerifySleepPytorchjob
[Teardown] Teardown Training Operator E2E Upgrade Test Suite

Verify that the must-gather image provides RHODS logs and info
[Documentation] Tests the must-gather image for ODH/RHOAI after upgrading
[Tags] Upgrade
Get must-gather Logs
Verify logs for ${APPLICATIONS_NAMESPACE}
IF "${PRODUCT}" == "RHODS"
Verify Logs For ${OPERATOR_NAMESPACE}
Run Keyword If RHODS Is Managed Verify logs for ${MONITORING_NAMESPACE}
END
[Teardown] Cleanup must-gather Logs


*** Keywords ***
Dashboard Suite Setup
Expand Down

0 comments on commit 9478b82

Please sign in to comment.