Sridevi Ramesh | d737eb9 | 2019-02-13 05:03:21 -0600 | [diff] [blame] | 1 | *** Settings *** |
George Keishing | 4583a08 | 2019-02-25 10:28:42 -0600 | [diff] [blame] | 2 | Documentation This suite tests Redfish Host power operations. |
| 3 | |
Sridevi Ramesh | d737eb9 | 2019-02-13 05:03:21 -0600 | [diff] [blame] | 4 | Resource ../../lib/boot_utils.robot |
George Keishing | 36c39aa | 2019-03-01 04:33:58 -0600 | [diff] [blame] | 5 | Resource ../../lib/common_utils.robot |
George Keishing | d8c8b31 | 2019-04-09 11:34:58 -0500 | [diff] [blame] | 6 | Resource ../../lib/open_power_utils.robot |
Sridevi Ramesh | d737eb9 | 2019-02-13 05:03:21 -0600 | [diff] [blame] | 7 | |
George Keishing | 36c39aa | 2019-03-01 04:33:58 -0600 | [diff] [blame] | 8 | Test Setup Test Setup Execution |
| 9 | Test Teardown Test Teardown Execution |
Sridevi Ramesh | d737eb9 | 2019-02-13 05:03:21 -0600 | [diff] [blame] | 10 | |
George Keishing | f688800 | 2020-09-29 09:12:21 -0500 | [diff] [blame] | 11 | *** Variables *** |
| 12 | |
| 13 | # Extended code to check OCC state, power metric and others. |
| 14 | ${additional_power_check} ${1} |
| 15 | |
Sridevi Ramesh | d737eb9 | 2019-02-13 05:03:21 -0600 | [diff] [blame] | 16 | *** Test Cases *** |
| 17 | |
George Keishing | 4583a08 | 2019-02-25 10:28:42 -0600 | [diff] [blame] | 18 | Verify Redfish Host GracefulShutdown |
| 19 | [Documentation] Verify Redfish host graceful shutdown operation. |
| 20 | [Tags] Verify_Redfish_Host_GracefulShutdown |
Sridevi Ramesh | d737eb9 | 2019-02-13 05:03:21 -0600 | [diff] [blame] | 21 | |
| 22 | Redfish Power Off |
| 23 | |
George Keishing | 9833f96 | 2019-10-07 12:37:57 -0500 | [diff] [blame] | 24 | |
Lei YU | 46b1a8e | 2020-01-16 14:21:53 +0800 | [diff] [blame] | 25 | Verify Redfish BMC PowerOn With OCC State |
| 26 | [Documentation] Verify Redfish host power on operation. |
| 27 | [Tags] Verify_Redfish_BMC_PowerOn_With_OCC_State |
| 28 | |
| 29 | Redfish Power On |
| 30 | |
| 31 | # TODO: Replace OCC state check with redfish property when available. |
| 32 | Verify OCC State |
| 33 | |
| 34 | |
Sridevi Ramesh | d737eb9 | 2019-02-13 05:03:21 -0600 | [diff] [blame] | 35 | Verify Redfish BMC PowerOn |
George Keishing | 4583a08 | 2019-02-25 10:28:42 -0600 | [diff] [blame] | 36 | [Documentation] Verify Redfish host power on operation. |
| 37 | [Tags] Verify_Redfish_Host_PowerOn |
Sridevi Ramesh | d737eb9 | 2019-02-13 05:03:21 -0600 | [diff] [blame] | 38 | |
| 39 | Redfish Power On |
| 40 | |
George Keishing | d918148 | 2021-10-08 08:13:22 -0500 | [diff] [blame] | 41 | Run Keyword If ${additional_power_check} == ${1} |
| 42 | ... Wait Until Keyword Succeeds 3 mins 30 secs Match OCC And CPU State Count |
| 43 | |
| 44 | Run Keyword If ${additional_power_check} == ${1} Power Check |
George Keishing | 9833f96 | 2019-10-07 12:37:57 -0500 | [diff] [blame] | 45 | |
| 46 | |
Sridevi Ramesh | d737eb9 | 2019-02-13 05:03:21 -0600 | [diff] [blame] | 47 | Verify Redfish BMC GracefulRestart |
George Keishing | 4583a08 | 2019-02-25 10:28:42 -0600 | [diff] [blame] | 48 | [Documentation] Verify Redfish host graceful restart operation. |
| 49 | [Tags] Verify_Redfish_Host_GracefulRestart |
Sridevi Ramesh | d737eb9 | 2019-02-13 05:03:21 -0600 | [diff] [blame] | 50 | |
George Keishing | e523fc0 | 2020-03-23 12:28:01 -0500 | [diff] [blame] | 51 | RF SYS GracefulRestart |
Sridevi Ramesh | d737eb9 | 2019-02-13 05:03:21 -0600 | [diff] [blame] | 52 | |
George Keishing | 9833f96 | 2019-10-07 12:37:57 -0500 | [diff] [blame] | 53 | |
Sridevi Ramesh | d737eb9 | 2019-02-13 05:03:21 -0600 | [diff] [blame] | 54 | Verify Redfish BMC PowerOff |
George Keishing | 4583a08 | 2019-02-25 10:28:42 -0600 | [diff] [blame] | 55 | [Documentation] Verify Redfish host power off operation. |
| 56 | [Tags] Verify_Redfish_Host_PowerOff |
Sridevi Ramesh | d737eb9 | 2019-02-13 05:03:21 -0600 | [diff] [blame] | 57 | |
| 58 | Redfish Hard Power Off |
George Keishing | 36c39aa | 2019-03-01 04:33:58 -0600 | [diff] [blame] | 59 | |
| 60 | *** Keywords *** |
| 61 | |
| 62 | Test Setup Execution |
| 63 | [Documentation] Do test case setup tasks. |
| 64 | |
George Keishing | 9833f96 | 2019-10-07 12:37:57 -0500 | [diff] [blame] | 65 | Printn |
George Keishing | 36c39aa | 2019-03-01 04:33:58 -0600 | [diff] [blame] | 66 | Start SOL Console Logging |
George Keishing | 2997a28 | 2020-06-16 00:42:08 -0500 | [diff] [blame] | 67 | Redfish.Login |
George Keishing | 36c39aa | 2019-03-01 04:33:58 -0600 | [diff] [blame] | 68 | |
| 69 | |
| 70 | Test Teardown Execution |
| 71 | [Documentation] Collect FFDC and SOL log. |
| 72 | |
| 73 | FFDC On Test Case Fail |
| 74 | ${sol_log}= Stop SOL Console Logging |
| 75 | Log ${sol_log} |
George Keishing | 99a6205 | 2020-06-12 13:32:13 -0500 | [diff] [blame] | 76 | |
| 77 | Run Keyword If ${REDFISH_SUPPORTED} |
| 78 | ... Redfish Set Auto Reboot RetryAttempts |
| 79 | ... ELSE |
| 80 | ... Set Auto Reboot ${1} |
George Keishing | 2997a28 | 2020-06-16 00:42:08 -0500 | [diff] [blame] | 81 | Redfish.Logout |
George Keishing | f688800 | 2020-09-29 09:12:21 -0500 | [diff] [blame] | 82 | |
| 83 | |
George Keishing | d918148 | 2021-10-08 08:13:22 -0500 | [diff] [blame] | 84 | Power Check |
| 85 | [Documentation] Verify PowerConsumedWatts property. |
George Keishing | f688800 | 2020-09-29 09:12:21 -0500 | [diff] [blame] | 86 | |
| 87 | ${power_uri_list}= redfish_utils.Get Members URI /redfish/v1/Chassis/ PowerControl |
| 88 | Log List ${power_uri_list} |
| 89 | |
| 90 | # Power entries could be seen across different redfish path, remove the URI |
| 91 | # where the attribute is non-existent. |
| 92 | # Example: |
| 93 | # ['/redfish/v1/Chassis/chassis/Power', |
| 94 | # '/redfish/v1/Chassis/motherboard/Power'] |
| 95 | FOR ${idx} IN @{power_uri_list} |
| 96 | ${power_control}= redfish_utils.Get Attribute ${idx} PowerControl |
| 97 | Log Dictionary ${power_control[0]} |
| 98 | |
| 99 | # Ensure the path does have the attribute else set to EMPTY as default to skip. |
| 100 | ${value}= Get Variable Value ${power_control[0]['PowerConsumedWatts']} ${EMPTY} |
| 101 | Run Keyword If "${value}" == "${EMPTY}" |
| 102 | ... Remove Values From List ${power_uri_list} ${idx} |
| 103 | |
| 104 | # Check the next available element in the list. |
| 105 | Continue For Loop If "${value}" == "${EMPTY}" |
| 106 | |
| 107 | Valid Dict power_control[${0}] ['PowerConsumedWatts'] |
| 108 | |
| 109 | END |
| 110 | |
| 111 | # Double check, the validation has at least one valid path. |
| 112 | Should Not Be Empty ${power_uri_list} |
| 113 | ... msg=Should contain at least one element in the list. |