blob: 949de6f18fcbbc0a11218dd5624e798c4c3f041d [file] [log] [blame]
George Keishing50cd0012017-09-14 12:23:41 -05001*** Settings ***
2Documentation Suite to test OCC power module.
3
George Keishing05d42fe2022-03-29 10:53:51 -05004Resource ../lib/bmc_redfish_resource.robot
5Resource ../lib/open_power_utils.robot
6Resource ../lib/boot_utils.robot
7Resource ../lib/state_manager.robot
8Resource ../lib/openbmc_ffdc.robot
9Resource ../lib/utils.robot
George Keishing50cd0012017-09-14 12:23:41 -050010
11Suite Setup Suite Setup Execution
12Test Teardown Test Teardown Execution
13
Sridevi Ramesh89666172025-09-28 04:15:29 -050014Test Tags Test_OCC_Power
15
George Keishing50cd0012017-09-14 12:23:41 -050016*** Test Cases ***
17
18Verify OCC Object Count
19 [Documentation] Verify that OCC and inventory entries match.
20 [Tags] Verify_OCC_Object_Count
21
22 # Example:
23 # /org/open_power/control/enumerate
24 # {
25 # "/org/open_power/control/host0": {},
26 # "/org/open_power/control/occ0": {
27 # "OccActive": 0
28 # },
29 # "/org/open_power/control/occ1": {
30 # "OccActive": 0
31 # }
32 # }
33
34 # Inventory counterpart cpu's:
35 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0",
36 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1",
37
38 ${inventory_count}= Count Object Entries
39 ... ${HOST_INVENTORY_URI}system/chassis/motherboard/ cpu*
40
41 Should Be Equal ${occ_count} ${inventory_count}
42 ... msg=OCC and inventory entry counts are mismatched.
43
George Keishing02a686b2019-06-12 13:00:43 -050044
George Keishing5d8dc122017-12-20 08:00:34 -060045Verify OCC State When Host Is Booted
Sweta Potthuri9d62b502017-10-10 03:57:42 -050046 [Documentation] Verify OCC state when host is booted.
George Keishing5d8dc122017-12-20 08:00:34 -060047 [Tags] Verify_OCC_State_When_Host_Is_Booted
George Keishing50cd0012017-09-14 12:23:41 -050048
Sweta Potthuri9d62b502017-10-10 03:57:42 -050049 Verify OCC State ${1}
George Keishing50cd0012017-09-14 12:23:41 -050050
George Keishing02a686b2019-06-12 13:00:43 -050051
Sweta Potthuri9d62b502017-10-10 03:57:42 -050052Verify OCC State After Host Reboot
53 [Documentation] Verify OCC state and count after host reboot.
54 [Tags] Verify_OCC_State_After_Host_Reboot
George Keishing50cd0012017-09-14 12:23:41 -050055
George Keishingfb218a12018-11-28 11:20:42 -060056 ${occ_count_before}= Count OCC Object Entry
Sweta Potthuri9d62b502017-10-10 03:57:42 -050057 Verify OCC State ${1}
George Keishinge523fc02020-03-23 12:28:01 -050058 RF SYS GracefulRestart
Sweta Potthuri9d62b502017-10-10 03:57:42 -050059 Verify OCC State ${1}
George Keishingfb218a12018-11-28 11:20:42 -060060 ${occ_count_after}= Count OCC Object Entry
Sweta Potthuri9d62b502017-10-10 03:57:42 -050061 Should be Equal ${occ_count_before} ${occ_count_after}
George Keishing50cd0012017-09-14 12:23:41 -050062
George Keishing02a686b2019-06-12 13:00:43 -050063
Sweta Potthuri9d62b502017-10-10 03:57:42 -050064Verify OCC State After BMC Reset
65 [Documentation] Verify OCC state and count after BMC reset.
66 [Tags] Verify_OCC_State_After_BMC_Reset
67
George Keishingfb218a12018-11-28 11:20:42 -060068 ${occ_count_before}= Count OCC Object Entry
George Keishing02a686b2019-06-12 13:00:43 -050069 Redfish OBMC Reboot (run)
Sweta Potthuri9d62b502017-10-10 03:57:42 -050070 Verify OCC State ${1}
George Keishingfb218a12018-11-28 11:20:42 -060071 ${occ_count_after}= Count OCC Object Entry
Sweta Potthuri9d62b502017-10-10 03:57:42 -050072 Should be Equal ${occ_count_before} ${occ_count_after}
73
George Keishing02a686b2019-06-12 13:00:43 -050074
Sweta Potthuri9d62b502017-10-10 03:57:42 -050075Verify OCC State At Standby
76 [Documentation] Verify OCC state at standby.
77 [Tags] Verify_OCC_State_At_Standby
78
George Keishing02a686b2019-06-12 13:00:43 -050079 Redfish Power Off stack_mode=normal
Sweta Potthuri9d62b502017-10-10 03:57:42 -050080 Verify OCC State ${0}
George Keishing50cd0012017-09-14 12:23:41 -050081
82*** Keywords ***
83
84Suite Setup Execution
85 [Documentation] Do the initial test suite setup.
George Keishing50cd0012017-09-14 12:23:41 -050086
George Keishing02a686b2019-06-12 13:00:43 -050087 Redfish Power On
George Keishing50cd0012017-09-14 12:23:41 -050088 Count OCC Object Entry
89
George Keishing50cd0012017-09-14 12:23:41 -050090Count OCC Object Entry
91 [Documentation] Count OCC object entry and set count.
92
93 ${object_count}= Count Object Entries ${OPENPOWER_CONTROL} occ*
94 Set Suite Variable ${occ_count] ${object_count}
95
96
97Test Teardown Execution
98 [Documentation] Do the post test teardown.
99 # - Capture FFDC on test failure.
100 # - Delete error logs.
101 # - Close all open SSH connections.
102
103 FFDC On Test Case Fail
George Keishing02a686b2019-06-12 13:00:43 -0500104 Redfish.Login
105 Redfish Purge Event Log
George Keishing50cd0012017-09-14 12:23:41 -0500106 Close All Connections