1*** Settings ***
2Documentation    This suite tests Redfish Host power operations.
3
4Resource         ../../lib/boot_utils.robot
5Resource         ../../lib/common_utils.robot
6Resource         ../../lib/open_power_utils.robot
7
8Test Setup       Test Setup Execution
9Test Teardown    Test Teardown Execution
10
11*** Test Cases ***
12
13Verify Redfish Host GracefulShutdown
14    [Documentation]  Verify Redfish host graceful shutdown operation.
15    [Tags]  Verify_Redfish_Host_GracefulShutdown
16
17    Redfish Power Off
18
19
20Verify 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
30Verify Redfish BMC PowerOn
31    [Documentation]  Verify Redfish host power on operation.
32    [Tags]  Verify_Redfish_Host_PowerOn
33
34    Redfish Power On
35
36    # TODO: Replace OCC state check with redfish property when available.
37    Verify OCC State
38
39    Redfish.Login
40    ${power_control}=  Redfish.Get Attribute  ${REDFISH_CHASSIS_POWER_URI}  PowerControl
41    Rprint Vars   power_control
42    Valid Dict  power_control[${0}]  ['PowerConsumedWatts']
43
44
45Verify Redfish BMC GracefulRestart
46    [Documentation]  Verify Redfish host graceful restart operation.
47    [Tags]  Verify_Redfish_Host_GracefulRestart
48
49    RF SYS GracefulRestart
50
51
52Verify Redfish BMC PowerOff
53    [Documentation]  Verify Redfish host power off operation.
54    [Tags]  Verify_Redfish_Host_PowerOff
55
56    Redfish Hard Power Off
57
58*** Keywords ***
59
60Test Setup Execution
61    [Documentation]  Do test case setup tasks.
62
63    Printn
64    Start SOL Console Logging
65
66
67Test Teardown Execution
68    [Documentation]  Collect FFDC and SOL log.
69
70    FFDC On Test Case Fail
71    ${sol_log}=    Stop SOL Console Logging
72    Log   ${sol_log}
73
74    Run Keyword If  ${REDFISH_SUPPORTED}
75    ...    Redfish Set Auto Reboot  RetryAttempts
76    ...  ELSE
77    ...    Set Auto Reboot  ${1}
78