blob: 4797e27ed680f9c646e3ec2a0191522395126dbb [file] [log] [blame]
Sridevi Rameshd737eb92019-02-13 05:03:21 -06001*** Settings ***
George Keishing4583a082019-02-25 10:28:42 -06002Documentation This suite tests Redfish Host power operations.
3
Sridevi Rameshd737eb92019-02-13 05:03:21 -06004Resource ../../lib/boot_utils.robot
George Keishing36c39aa2019-03-01 04:33:58 -06005Resource ../../lib/common_utils.robot
George Keishingd8c8b312019-04-09 11:34:58 -05006Resource ../../lib/open_power_utils.robot
Sridevi Rameshd737eb92019-02-13 05:03:21 -06007
George Keishing36c39aa2019-03-01 04:33:58 -06008Test Setup Test Setup Execution
9Test Teardown Test Teardown Execution
Sridevi Rameshd737eb92019-02-13 05:03:21 -060010
11*** Test Cases ***
12
George Keishing4583a082019-02-25 10:28:42 -060013Verify Redfish Host GracefulShutdown
14 [Documentation] Verify Redfish host graceful shutdown operation.
15 [Tags] Verify_Redfish_Host_GracefulShutdown
Sridevi Rameshd737eb92019-02-13 05:03:21 -060016
17 Redfish Power Off
18
George Keishing9833f962019-10-07 12:37:57 -050019
Lei YU46b1a8e2020-01-16 14:21:53 +080020Verify Redfish BMC PowerOn With OCC State
21 [Documentation] Verify Redfish host power on operation.
22 [Tags] Verify_Redfish_BMC_PowerOn_With_OCC_State
23
24 Redfish Power On
25
26 # TODO: Replace OCC state check with redfish property when available.
27 Verify OCC State
28
29
Sridevi Rameshd737eb92019-02-13 05:03:21 -060030Verify Redfish BMC PowerOn
George Keishing4583a082019-02-25 10:28:42 -060031 [Documentation] Verify Redfish host power on operation.
32 [Tags] Verify_Redfish_Host_PowerOn
Sridevi Rameshd737eb92019-02-13 05:03:21 -060033
34 Redfish Power On
35
George Keishingd8c8b312019-04-09 11:34:58 -050036 # TODO: Replace OCC state check with redfish property when available.
37 Verify OCC State
38
George Keishing6dbadc52020-07-15 09:24:41 -050039 ${power_uri_list}= redfish_utils.Get Members URI /redfish/v1/Chassis/ PowerControl
40 Log List ${power_uri_list}
41
42 # Power entries could be seen across different redfish path, remove the URI
43 # where the attribute is non-existent.
44 # Example:
45 # ['/redfish/v1/Chassis/chassis/Power',
46 # '/redfish/v1/Chassis/motherboard/Power']
47 FOR ${idx} IN @{power_uri_list}
48 ${power_control}= redfish_utils.Get Attribute ${idx} PowerControl
49 Log Dictionary ${power_control[0]}
50
51 # Ensure the path does have the attribute else set to EMPTY as default to skip.
52 ${value}= Get Variable Value ${power_control[0]['PowerConsumedWatts']} ${EMPTY}
53 Run Keyword If "${value}" == "${EMPTY}"
54 ... Remove Values From List ${power_uri_list} ${idx}
55
56 # Check the next available element in the list.
57 Continue For Loop If "${value}" == "${EMPTY}"
58
59 Valid Dict power_control[${0}] ['PowerConsumedWatts']
60
61 END
62
George Keishinge68cbfb2020-08-12 11:11:58 -050063 # Double check, the validation has at least one valid path.
George Keishing6dbadc52020-07-15 09:24:41 -050064 Should Not Be Empty ${power_uri_list}
George Keishinge68cbfb2020-08-12 11:11:58 -050065 ... msg=Should contain at least one element in the list.
George Keishing9833f962019-10-07 12:37:57 -050066
67
Sridevi Rameshd737eb92019-02-13 05:03:21 -060068Verify Redfish BMC GracefulRestart
George Keishing4583a082019-02-25 10:28:42 -060069 [Documentation] Verify Redfish host graceful restart operation.
70 [Tags] Verify_Redfish_Host_GracefulRestart
Sridevi Rameshd737eb92019-02-13 05:03:21 -060071
George Keishinge523fc02020-03-23 12:28:01 -050072 RF SYS GracefulRestart
Sridevi Rameshd737eb92019-02-13 05:03:21 -060073
George Keishing9833f962019-10-07 12:37:57 -050074
Sridevi Rameshd737eb92019-02-13 05:03:21 -060075Verify Redfish BMC PowerOff
George Keishing4583a082019-02-25 10:28:42 -060076 [Documentation] Verify Redfish host power off operation.
77 [Tags] Verify_Redfish_Host_PowerOff
Sridevi Rameshd737eb92019-02-13 05:03:21 -060078
79 Redfish Hard Power Off
George Keishing36c39aa2019-03-01 04:33:58 -060080
81*** Keywords ***
82
83Test Setup Execution
84 [Documentation] Do test case setup tasks.
85
George Keishing9833f962019-10-07 12:37:57 -050086 Printn
George Keishing36c39aa2019-03-01 04:33:58 -060087 Start SOL Console Logging
George Keishing2997a282020-06-16 00:42:08 -050088 Redfish.Login
George Keishing36c39aa2019-03-01 04:33:58 -060089
90
91Test Teardown Execution
92 [Documentation] Collect FFDC and SOL log.
93
94 FFDC On Test Case Fail
95 ${sol_log}= Stop SOL Console Logging
96 Log ${sol_log}
George Keishing99a62052020-06-12 13:32:13 -050097
98 Run Keyword If ${REDFISH_SUPPORTED}
99 ... Redfish Set Auto Reboot RetryAttempts
100 ... ELSE
101 ... Set Auto Reboot ${1}
George Keishing2997a282020-06-16 00:42:08 -0500102 Redfish.Logout