George Keishing | 50cd001 | 2017-09-14 12:23:41 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Suite to test OCC power module. |
| 3 | |
| 4 | Resource ../lib/open_power_utils.robot |
| 5 | Resource ../lib/boot_utils.robot |
| 6 | Resource ../lib/state_manager.robot |
| 7 | Resource ../lib/openbmc_ffdc.robot |
| 8 | |
| 9 | Suite Setup Suite Setup Execution |
| 10 | Test Teardown Test Teardown Execution |
| 11 | |
| 12 | *** Test Cases *** |
| 13 | |
| 14 | Verify OCC Object Count |
| 15 | [Documentation] Verify that OCC and inventory entries match. |
| 16 | [Tags] Verify_OCC_Object_Count |
| 17 | |
| 18 | # Example: |
| 19 | # /org/open_power/control/enumerate |
| 20 | # { |
| 21 | # "/org/open_power/control/host0": {}, |
| 22 | # "/org/open_power/control/occ0": { |
| 23 | # "OccActive": 0 |
| 24 | # }, |
| 25 | # "/org/open_power/control/occ1": { |
| 26 | # "OccActive": 0 |
| 27 | # } |
| 28 | # } |
| 29 | |
| 30 | # Inventory counterpart cpu's: |
| 31 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0", |
| 32 | # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1", |
| 33 | |
| 34 | ${inventory_count}= Count Object Entries |
| 35 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard/ cpu* |
| 36 | |
| 37 | Should Be Equal ${occ_count} ${inventory_count} |
| 38 | ... msg=OCC and inventory entry counts are mismatched. |
| 39 | |
Sweta Potthuri | 9d62b50 | 2017-10-10 03:57:42 -0500 | [diff] [blame] | 40 | Verify When Host Is Booted |
| 41 | [Documentation] Verify OCC state when host is booted. |
| 42 | [Tags] Verify_When_Host_Is_Booted |
George Keishing | 50cd001 | 2017-09-14 12:23:41 -0500 | [diff] [blame] | 43 | |
Sweta Potthuri | 9d62b50 | 2017-10-10 03:57:42 -0500 | [diff] [blame] | 44 | Verify OCC State ${1} |
George Keishing | 50cd001 | 2017-09-14 12:23:41 -0500 | [diff] [blame] | 45 | |
Sweta Potthuri | 9d62b50 | 2017-10-10 03:57:42 -0500 | [diff] [blame] | 46 | Verify OCC State After Host Reboot |
| 47 | [Documentation] Verify OCC state and count after host reboot. |
| 48 | [Tags] Verify_OCC_State_After_Host_Reboot |
George Keishing | 50cd001 | 2017-09-14 12:23:41 -0500 | [diff] [blame] | 49 | |
Sweta Potthuri | 9d62b50 | 2017-10-10 03:57:42 -0500 | [diff] [blame] | 50 | ${occ_count_before} = Count OCC Object Entry |
| 51 | Verify OCC State ${1} |
| 52 | REST OBMC Reboot (run) stack_mode=normal quiet=1 |
| 53 | Verify OCC State ${1} |
| 54 | ${occ_count_after} = Count OCC Object Entry |
| 55 | Should be Equal ${occ_count_before} ${occ_count_after} |
George Keishing | 50cd001 | 2017-09-14 12:23:41 -0500 | [diff] [blame] | 56 | |
Sweta Potthuri | 9d62b50 | 2017-10-10 03:57:42 -0500 | [diff] [blame] | 57 | Verify OCC State After BMC Reset |
| 58 | [Documentation] Verify OCC state and count after BMC reset. |
| 59 | [Tags] Verify_OCC_State_After_BMC_Reset |
| 60 | |
| 61 | ${occ_count_before} = Count OCC Object Entry |
| 62 | OBMC Reboot (run) |
| 63 | Verify OCC State ${1} |
| 64 | ${occ_count_after} = Count OCC Object Entry |
| 65 | Should be Equal ${occ_count_before} ${occ_count_after} |
| 66 | |
| 67 | Verify OCC State At Standby |
| 68 | [Documentation] Verify OCC state at standby. |
| 69 | [Tags] Verify_OCC_State_At_Standby |
| 70 | |
| 71 | REST Power Off stack_mode=normal |
| 72 | Verify OCC State ${0} |
George Keishing | 50cd001 | 2017-09-14 12:23:41 -0500 | [diff] [blame] | 73 | |
| 74 | *** Keywords *** |
| 75 | |
| 76 | Suite Setup Execution |
| 77 | [Documentation] Do the initial test suite setup. |
| 78 | # - Power off. |
| 79 | # - Boot Host. |
| 80 | |
| 81 | Smart Power Off |
| 82 | REST Power On |
| 83 | Count OCC Object Entry |
| 84 | |
George Keishing | 50cd001 | 2017-09-14 12:23:41 -0500 | [diff] [blame] | 85 | Count OCC Object Entry |
| 86 | [Documentation] Count OCC object entry and set count. |
| 87 | |
| 88 | ${object_count}= Count Object Entries ${OPENPOWER_CONTROL} occ* |
| 89 | Set Suite Variable ${occ_count] ${object_count} |
| 90 | |
| 91 | |
| 92 | Test Teardown Execution |
| 93 | [Documentation] Do the post test teardown. |
| 94 | # - Capture FFDC on test failure. |
| 95 | # - Delete error logs. |
| 96 | # - Close all open SSH connections. |
| 97 | |
| 98 | FFDC On Test Case Fail |
| 99 | Delete Error Logs |
| 100 | Close All Connections |
| 101 | |
Sweta Potthuri | 9d62b50 | 2017-10-10 03:57:42 -0500 | [diff] [blame] | 102 | Verify OCC State |
| 103 | [Documentation] Check OCC active state. |
| 104 | [Arguments] ${expected_occ_active}=${1} |
| 105 | # Description of Argument(s): |
| 106 | # expected_occ_active The expected occ_active value (i.e. 1/0). |
| 107 | |
| 108 | # Example cpu_list data output: |
| 109 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0 |
| 110 | # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1 |
| 111 | ${cpu_list}= Get Endpoint Paths |
| 112 | ... ${HOST_INVENTORY_URI}system/chassis/motherboard/ cpu* |
| 113 | |
| 114 | :FOR ${endpoint_path} IN @{cpu_list} |
| 115 | \ ${is_functional}= Read Object Attribute ${endpoint_path} Functional |
| 116 | \ Continue For Loop If ${is_functional} == ${0} |
| 117 | \ ${num}= Set Variable ${endpoint_path[-1]} |
| 118 | \ ${occ_active}= Get OCC Active State ${OPENPOWER_CONTROL}occ${num} |
| 119 | \ Should Be Equal ${occ_active} ${expected_occ_active} msg=OCC not in right state |