blob: 3efc0776d2474196a29c7f766175fcc4ea991387 [file] [log] [blame]
George Keishing50cd0012017-09-14 12:23:41 -05001*** Settings ***
2Documentation Suite to test OCC power module.
3
George Keishing02a686b2019-06-12 13:00:43 -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
14*** Test Cases ***
15
16Verify OCC Object Count
17 [Documentation] Verify that OCC and inventory entries match.
18 [Tags] Verify_OCC_Object_Count
19
20 # Example:
21 # /org/open_power/control/enumerate
22 # {
23 # "/org/open_power/control/host0": {},
24 # "/org/open_power/control/occ0": {
25 # "OccActive": 0
26 # },
27 # "/org/open_power/control/occ1": {
28 # "OccActive": 0
29 # }
30 # }
31
32 # Inventory counterpart cpu's:
33 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0",
34 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1",
35
36 ${inventory_count}= Count Object Entries
37 ... ${HOST_INVENTORY_URI}system/chassis/motherboard/ cpu*
38
39 Should Be Equal ${occ_count} ${inventory_count}
40 ... msg=OCC and inventory entry counts are mismatched.
41
George Keishing02a686b2019-06-12 13:00:43 -050042
George Keishing5d8dc122017-12-20 08:00:34 -060043Verify OCC State When Host Is Booted
Sweta Potthuri9d62b502017-10-10 03:57:42 -050044 [Documentation] Verify OCC state when host is booted.
George Keishing5d8dc122017-12-20 08:00:34 -060045 [Tags] Verify_OCC_State_When_Host_Is_Booted
George Keishing50cd0012017-09-14 12:23:41 -050046
Sweta Potthuri9d62b502017-10-10 03:57:42 -050047 Verify OCC State ${1}
George Keishing50cd0012017-09-14 12:23:41 -050048
George Keishing02a686b2019-06-12 13:00:43 -050049
Sweta Potthuri9d62b502017-10-10 03:57:42 -050050Verify OCC State After Host Reboot
51 [Documentation] Verify OCC state and count after host reboot.
52 [Tags] Verify_OCC_State_After_Host_Reboot
George Keishing50cd0012017-09-14 12:23:41 -050053
George Keishingfb218a12018-11-28 11:20:42 -060054 ${occ_count_before}= Count OCC Object Entry
Sweta Potthuri9d62b502017-10-10 03:57:42 -050055 Verify OCC State ${1}
George Keishing02a686b2019-06-12 13:00:43 -050056 Redfish Host Reboot
Sweta Potthuri9d62b502017-10-10 03:57:42 -050057 Verify OCC State ${1}
George Keishingfb218a12018-11-28 11:20:42 -060058 ${occ_count_after}= Count OCC Object Entry
Sweta Potthuri9d62b502017-10-10 03:57:42 -050059 Should be Equal ${occ_count_before} ${occ_count_after}
George Keishing50cd0012017-09-14 12:23:41 -050060
George Keishing02a686b2019-06-12 13:00:43 -050061
Sweta Potthuri9d62b502017-10-10 03:57:42 -050062Verify OCC State After BMC Reset
63 [Documentation] Verify OCC state and count after BMC reset.
64 [Tags] Verify_OCC_State_After_BMC_Reset
65
George Keishingfb218a12018-11-28 11:20:42 -060066 ${occ_count_before}= Count OCC Object Entry
George Keishing02a686b2019-06-12 13:00:43 -050067 Redfish OBMC Reboot (run)
Sweta Potthuri9d62b502017-10-10 03:57:42 -050068 Verify OCC State ${1}
George Keishingfb218a12018-11-28 11:20:42 -060069 ${occ_count_after}= Count OCC Object Entry
Sweta Potthuri9d62b502017-10-10 03:57:42 -050070 Should be Equal ${occ_count_before} ${occ_count_after}
71
George Keishing02a686b2019-06-12 13:00:43 -050072
Sweta Potthuri9d62b502017-10-10 03:57:42 -050073Verify OCC State At Standby
74 [Documentation] Verify OCC state at standby.
75 [Tags] Verify_OCC_State_At_Standby
76
George Keishing02a686b2019-06-12 13:00:43 -050077 Redfish Power Off stack_mode=normal
Sweta Potthuri9d62b502017-10-10 03:57:42 -050078 Verify OCC State ${0}
George Keishing50cd0012017-09-14 12:23:41 -050079
80*** Keywords ***
81
82Suite Setup Execution
83 [Documentation] Do the initial test suite setup.
George Keishing50cd0012017-09-14 12:23:41 -050084
George Keishing02a686b2019-06-12 13:00:43 -050085 Redfish Power On
George Keishing50cd0012017-09-14 12:23:41 -050086 Count OCC Object Entry
87
George Keishing50cd0012017-09-14 12:23:41 -050088Count OCC Object Entry
89 [Documentation] Count OCC object entry and set count.
90
91 ${object_count}= Count Object Entries ${OPENPOWER_CONTROL} occ*
92 Set Suite Variable ${occ_count] ${object_count}
93
94
95Test Teardown Execution
96 [Documentation] Do the post test teardown.
97 # - Capture FFDC on test failure.
98 # - Delete error logs.
99 # - Close all open SSH connections.
100
101 FFDC On Test Case Fail
George Keishing02a686b2019-06-12 13:00:43 -0500102 Redfish.Login
103 Redfish Purge Event Log
George Keishing50cd0012017-09-14 12:23:41 -0500104 Close All Connections