Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation Module to test PLDM platform commands. |
| 4 | |
Sridevi Ramesh | fc3b07f | 2020-02-27 04:22:24 -0600 | [diff] [blame] | 5 | Library ../lib/pldm_utils.py |
| 6 | Variables ../data/pldm_variables.py |
| 7 | Resource ../lib/openbmc_ffdc.robot |
| 8 | Resource ../lib/bmc_redfish_resource.robot |
| 9 | Resource ../lib/boot_utils.robot |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 10 | |
Sridevi Ramesh | fc3b07f | 2020-02-27 04:22:24 -0600 | [diff] [blame] | 11 | Test Setup Printn |
| 12 | Test Teardown FFDC On Test Case Fail |
| 13 | Suite Teardown Pldmtool Platform Suite Cleanup |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 14 | |
| 15 | *** Test Cases *** |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 16 | Verify GetPDR |
| 17 | [Documentation] Verify GetPDR (Platform Descpritor Record) response message. |
| 18 | [Tags] Verify_GetPDR |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 19 | |
Sridevi Ramesh | 538d18d | 2020-03-30 11:45:42 -0500 | [diff] [blame] | 20 | ${record_handle}= Set Variable ${1} |
| 21 | # Note: Record handle count is unknown and it is dynamic in nature. |
| 22 | # Assuming there are 100 record handle. |
| 23 | FOR ${i} IN RANGE 100 |
| 24 | ${next_record_handle}= Run Keyword Verify GetPDR For Record Handle ${record_handle} |
| 25 | Exit For Loop If ${next_record_handle} == 0 |
| 26 | ${record_handle}= Set Variable ${next_record_handle} |
| 27 | END |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 28 | |
Sridevi Ramesh | dfc7fcb | 2020-07-23 03:03:57 -0500 | [diff] [blame] | 29 | |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 30 | Verify SetStateEffecterStates |
| 31 | [Documentation] Verify set state effecter states response message. |
| 32 | [Tags] Verify_SetStateEffecterStates |
| 33 | [Template] Verify SetStateEffecterStates For Effecter States |
| 34 | |
Sridevi Ramesh | ca3223a | 2020-03-11 03:58:58 -0500 | [diff] [blame] | 35 | # EffecterHandle Count EffecterStates (effecterID effecterState) |
| 36 | |
Sridevi Ramesh | 538d18d | 2020-03-30 11:45:42 -0500 | [diff] [blame] | 37 | '1' '1' '1 1' # (effecterState -> 1 -> 'Boot Not Active') |
| 38 | '1' '1' '1 2' # (effecterState -> 2 -> 'Boot Completed') |
| 39 | '2' '1' '1 9' # (effecterState -> 9 -> 'System Power is in soft off mode') |
| 40 | '3' '1' '1 6' # (effecterState -> 6 -> 'Graceful Restart Requested') |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 41 | |
| 42 | *** Keywords *** |
| 43 | |
| 44 | Verify GetPDR For Record Handle |
Sridevi Ramesh | 538d18d | 2020-03-30 11:45:42 -0500 | [diff] [blame] | 45 | [Documentation] Verify GetPDR (Platform Descpritor Record) for given input |
| 46 | ... record handle and return next record handle. |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 47 | [Arguments] ${record_handle} |
| 48 | |
| 49 | # Description of argument(s): |
Sridevi Ramesh | ca3223a | 2020-03-11 03:58:58 -0500 | [diff] [blame] | 50 | # ${record_handle} Record handle. |
Sridevi Ramesh | 538d18d | 2020-03-30 11:45:42 -0500 | [diff] [blame] | 51 | # e.g. '1' is record handle 'Boot Progress' (196). |
| 52 | # '2' is record handle 'System Power State (260)'. |
| 53 | # '3' is record handle 'Software Termination Status (129)'. |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 54 | |
| 55 | # pldm_output: |
| 56 | # [responseCount]: 29 |
| 57 | # [recordHandle]: 1 |
| 58 | # [PDRHeaderVersion]: 1 |
| 59 | # [PDRType]: 11 |
| 60 | # [recordChangeNumber]: 0 |
| 61 | # [dataLength]: 19 |
| 62 | # [PLDMTerminusHandle]: 0 |
| 63 | # [effecterID]: 1 |
| 64 | # [entityType]: 33 |
| 65 | # [entityInstanceNumber]: 0 |
| 66 | # [containerID]: 0 |
| 67 | # [effecterSemanticID]: 0 |
| 68 | # [effecterInit]: 0 |
| 69 | # [effecterDescriptionPDR]: false |
| 70 | # [compositeEffecterCount]: 1 |
| 71 | # [stateSetID]: 196 |
| 72 | # [possibleStatesSize]: 1 |
| 73 | # [possibleStates]: 6 |
| 74 | |
| 75 | ${pldm_cmd}= Evaluate $CMD_GETPDR % ${record_handle} |
| 76 | ${pldm_output}= Pldmtool ${pldm_cmd} |
| 77 | Rprint Vars pldm_output |
Sridevi Ramesh | da95c47 | 2020-07-28 06:51:48 -0500 | [diff] [blame] | 78 | |
Sridevi Ramesh | 072d5af | 2020-06-02 09:20:57 -0500 | [diff] [blame] | 79 | # Note: Output of GetPDR type 'PLDM_NUMERIC_EFFECTER_PDR' has dynamic content |
| 80 | # hence just checking pdrtype only |
| 81 | # GetPDR type 'PLDM_STATE_SENSOR_PDR' Dev implementation is still in progress |
| 82 | # TODO: Verify output of GetPDR type 'PLDM_STATE_SENSOR_PDR' |
Sridevi Ramesh | da95c47 | 2020-07-28 06:51:48 -0500 | [diff] [blame] | 83 | |
Sridevi Ramesh | dfc7fcb | 2020-07-23 03:03:57 -0500 | [diff] [blame] | 84 | Run Keyword If '${pldm_output['pdrtype']}' == '${PLDM_PDR_TYPES['PLDM_STATE_EFFECTER_PDR']}' |
Sridevi Ramesh | da95c47 | 2020-07-28 06:51:48 -0500 | [diff] [blame] | 85 | ... Log To Console "Found PDR Type - PLDM_STATE_EFFECTER_PDR" |
| 86 | |
| 87 | ... ELSE IF '${pldm_output['pdrtype']}' == '${PLDM_PDR_TYPES['PLDM_PDR_FRU_RECORD_SET']}' |
Sridevi Ramesh | 538d18d | 2020-03-30 11:45:42 -0500 | [diff] [blame] | 88 | ... Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_FRURECORDSETIDENTIFIER} |
Sridevi Ramesh | dfc7fcb | 2020-07-23 03:03:57 -0500 | [diff] [blame] | 89 | |
Sridevi Ramesh | da95c47 | 2020-07-28 06:51:48 -0500 | [diff] [blame] | 90 | ... ELSE IF '${pldm_output['pdrtype']}' == '${PLDM_PDR_TYPES['PLDM_PDR_ENTITY_ASSOCIATION']}' |
| 91 | ... Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_PDRENTITYASSOCIATION} |
Sridevi Ramesh | dfc7fcb | 2020-07-23 03:03:57 -0500 | [diff] [blame] | 92 | |
Sridevi Ramesh | da95c47 | 2020-07-28 06:51:48 -0500 | [diff] [blame] | 93 | ... ELSE IF '${pldm_output['pdrtype']}' == '${PLDM_PDR_TYPES['PLDM_STATE_SENSOR_PDR']}' |
| 94 | ... Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_STATESENSORPDR} |
Sridevi Ramesh | dfc7fcb | 2020-07-23 03:03:57 -0500 | [diff] [blame] | 95 | |
Sridevi Ramesh | da95c47 | 2020-07-28 06:51:48 -0500 | [diff] [blame] | 96 | ... ELSE IF '${pldm_output['pdrtype']}' == '${PLDM_PDR_TYPES['PLDM_NUMERIC_EFFECTER_PDR']}' |
| 97 | ... Log To Console "Found PDR Type - PLDM_NUMERIC_EFFECTER_PDR" |
Sridevi Ramesh | dfc7fcb | 2020-07-23 03:03:57 -0500 | [diff] [blame] | 98 | |
Sridevi Ramesh | da95c47 | 2020-07-28 06:51:48 -0500 | [diff] [blame] | 99 | ... ELSE IF '${pldm_output['pdrtype']}' == '${PLDM_PDR_TYPES['PLDM_TERMINUS_LOCATOR_PDR']}' |
| 100 | ... Log To Console "Found PDR Type - PLDM_TERMINUS_LOCATOR_PDR" |
Sridevi Ramesh | dfc7fcb | 2020-07-23 03:03:57 -0500 | [diff] [blame] | 101 | |
Sridevi Ramesh | da95c47 | 2020-07-28 06:51:48 -0500 | [diff] [blame] | 102 | ... ELSE Fail msg="Unknown PDR Type is received" |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 103 | |
Sridevi Ramesh | 538d18d | 2020-03-30 11:45:42 -0500 | [diff] [blame] | 104 | Should be equal as strings ${pldm_output['recordhandle']} ${record_handle} |
| 105 | [Return] ${pldm_output['nextrecordhandle']} |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 106 | |
| 107 | Verify SetStateEffecterStates For Effecter States |
| 108 | [Documentation] Verify set state effecter states for given input effecter states. |
Sridevi Ramesh | ca3223a | 2020-03-11 03:58:58 -0500 | [diff] [blame] | 109 | [Arguments] ${effecter_handle} ${count} ${effecter_states} |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 110 | |
| 111 | # Description of argument(s): |
Sridevi Ramesh | ca3223a | 2020-03-11 03:58:58 -0500 | [diff] [blame] | 112 | # ${effecter_handle} A handle that is used to identify and access the effecter (e.g. '1'). |
| 113 | # e.g. '1' is effecter handle 'Boot Progress'. |
| 114 | # '2' is effecter handle 'System Power State'. |
| 115 | # ${count} The number of individual sets of effecter information (e.g. '1'). |
| 116 | # ${effecter_states} (effecterID effecterState). |
| 117 | # e.g. '1 1'. |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 118 | |
| 119 | # Example output: |
Sridevi Ramesh | 072d5af | 2020-06-02 09:20:57 -0500 | [diff] [blame] | 120 | # [SetStateEffecterStates ]: SUCCESS |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 121 | |
Sridevi Ramesh | ca3223a | 2020-03-11 03:58:58 -0500 | [diff] [blame] | 122 | ${pldm_cmd}= Evaluate $CMD_SETSTATEEFFECTERSTATES % (${effecter_handle}, ${count}, ${effecter_states}) |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 123 | ${pldm_output}= Pldmtool ${pldm_cmd} |
| 124 | Rprint Vars pldm_output |
| 125 | Valid Value pldm_output['setstateeffecterstates'] ['SUCCESS'] |
Sridevi Ramesh | fc3b07f | 2020-02-27 04:22:24 -0600 | [diff] [blame] | 126 | |
Sridevi Ramesh | fc3b07f | 2020-02-27 04:22:24 -0600 | [diff] [blame] | 127 | Pldmtool Platform Suite Cleanup |
| 128 | [Documentation] Reset BMC at suite cleanup. |
| 129 | |
George Keishing | 64fdf62 | 2020-06-18 02:49:38 -0500 | [diff] [blame] | 130 | Redfish.Login |
Sridevi Ramesh | 88f2172 | 2020-04-16 05:54:02 -0500 | [diff] [blame] | 131 | Redfish Hard Power Off |
Sridevi Ramesh | 072d5af | 2020-06-02 09:20:57 -0500 | [diff] [blame] | 132 | Redfish Power On |
George Keishing | 64fdf62 | 2020-06-18 02:49:38 -0500 | [diff] [blame] | 133 | Redfish.Logout |