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