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 | |
Matt Fischer | 6fb70d9 | 2023-10-24 19:06:33 -0600 | [diff] [blame^] | 15 | Test Tags Pldm_Platform |
George Keishing | 5431685 | 2023-10-16 14:03:29 +0530 | [diff] [blame] | 16 | |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 17 | *** Test Cases *** |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 18 | Verify GetPDR |
| 19 | [Documentation] Verify GetPDR (Platform Descpritor Record) response message. |
| 20 | [Tags] Verify_GetPDR |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 21 | |
Sridevi Ramesh | 538d18d | 2020-03-30 11:45:42 -0500 | [diff] [blame] | 22 | ${record_handle}= Set Variable ${1} |
| 23 | # Note: Record handle count is unknown and it is dynamic in nature. |
| 24 | # Assuming there are 100 record handle. |
| 25 | FOR ${i} IN RANGE 100 |
| 26 | ${next_record_handle}= Run Keyword Verify GetPDR For Record Handle ${record_handle} |
| 27 | Exit For Loop If ${next_record_handle} == 0 |
| 28 | ${record_handle}= Set Variable ${next_record_handle} |
| 29 | END |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 30 | |
| 31 | Verify SetStateEffecterStates |
| 32 | [Documentation] Verify set state effecter states response message. |
| 33 | [Tags] Verify_SetStateEffecterStates |
| 34 | [Template] Verify SetStateEffecterStates For Effecter States |
| 35 | |
Sridevi Ramesh | ca3223a | 2020-03-11 03:58:58 -0500 | [diff] [blame] | 36 | # EffecterHandle Count EffecterStates (effecterID effecterState) |
| 37 | |
Sridevi Ramesh | 538d18d | 2020-03-30 11:45:42 -0500 | [diff] [blame] | 38 | '1' '1' '1 1' # (effecterState -> 1 -> 'Boot Not Active') |
| 39 | '1' '1' '1 2' # (effecterState -> 2 -> 'Boot Completed') |
| 40 | '2' '1' '1 9' # (effecterState -> 9 -> 'System Power is in soft off mode') |
| 41 | '3' '1' '1 6' # (effecterState -> 6 -> 'Graceful Restart Requested') |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 42 | |
| 43 | *** Keywords *** |
| 44 | |
| 45 | Verify GetPDR For Record Handle |
Sridevi Ramesh | 538d18d | 2020-03-30 11:45:42 -0500 | [diff] [blame] | 46 | [Documentation] Verify GetPDR (Platform Descpritor Record) for given input |
| 47 | ... record handle and return next record handle. |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 48 | [Arguments] ${record_handle} |
| 49 | |
| 50 | # Description of argument(s): |
Sridevi Ramesh | ca3223a | 2020-03-11 03:58:58 -0500 | [diff] [blame] | 51 | # ${record_handle} Record handle. |
Sridevi Ramesh | 538d18d | 2020-03-30 11:45:42 -0500 | [diff] [blame] | 52 | # e.g. '1' is record handle 'Boot Progress' (196). |
| 53 | # '2' is record handle 'System Power State (260)'. |
| 54 | # '3' is record handle 'Software Termination Status (129)'. |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 55 | |
| 56 | # pldm_output: |
| 57 | # [responseCount]: 29 |
| 58 | # [recordHandle]: 1 |
| 59 | # [PDRHeaderVersion]: 1 |
| 60 | # [PDRType]: 11 |
| 61 | # [recordChangeNumber]: 0 |
| 62 | # [dataLength]: 19 |
| 63 | # [PLDMTerminusHandle]: 0 |
| 64 | # [effecterID]: 1 |
| 65 | # [entityType]: 33 |
| 66 | # [entityInstanceNumber]: 0 |
| 67 | # [containerID]: 0 |
| 68 | # [effecterSemanticID]: 0 |
| 69 | # [effecterInit]: 0 |
| 70 | # [effecterDescriptionPDR]: false |
| 71 | # [compositeEffecterCount]: 1 |
| 72 | # [stateSetID]: 196 |
| 73 | # [possibleStatesSize]: 1 |
| 74 | # [possibleStates]: 6 |
| 75 | |
| 76 | ${pldm_cmd}= Evaluate $CMD_GETPDR % ${record_handle} |
| 77 | ${pldm_output}= Pldmtool ${pldm_cmd} |
| 78 | Rprint Vars pldm_output |
Sridevi Ramesh | da95c47 | 2020-07-28 06:51:48 -0500 | [diff] [blame] | 79 | |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 80 | Run Keyword If '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_STATE_EFFECTER_PDR']}' |
| 81 | ... Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_SETSTATEEFFECTER} |
Sridevi Ramesh | da95c47 | 2020-07-28 06:51:48 -0500 | [diff] [blame] | 82 | |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 83 | ... 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] | 84 | ... Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_FRURECORDSETIDENTIFIER} |
Sridevi Ramesh | dfc7fcb | 2020-07-23 03:03:57 -0500 | [diff] [blame] | 85 | |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 86 | ... ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_PDR_ENTITY_ASSOCIATION']}' |
| 87 | ... Log To Console "Found PDR Type - PLDM_ENTITY_ASSOCIATION_PDR" |
Sridevi Ramesh | dfc7fcb | 2020-07-23 03:03:57 -0500 | [diff] [blame] | 88 | |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 89 | ... ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_STATE_SENSOR_PDR']}' |
Sridevi Ramesh | da95c47 | 2020-07-28 06:51:48 -0500 | [diff] [blame] | 90 | ... Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_STATESENSORPDR} |
Sridevi Ramesh | dfc7fcb | 2020-07-23 03:03:57 -0500 | [diff] [blame] | 91 | |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 92 | ... ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_NUMERIC_EFFECTER_PDR']}' |
| 93 | ... Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_NUMERICEFFECTERPDR} |
Sridevi Ramesh | dfc7fcb | 2020-07-23 03:03:57 -0500 | [diff] [blame] | 94 | |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 95 | ... ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_TERMINUS_LOCATOR_PDR']}' |
| 96 | ... Valid Dict pldm_output valid_values=${RESPONSE_DICT_GETPDR_TERMINUSLOCATORPDR} |
| 97 | |
| 98 | ... ELSE IF '${pldm_output['PDRType']}' == '${PLDM_PDR_TYPES['PLDM_COMPACT_NUMERIC_SENSOR_PDR']}' |
| 99 | ... Log To Console "Found PDR Type - PLDM_COMPACT_NUMERIC_SENSOR_PDR' |
Sridevi Ramesh | dfc7fcb | 2020-07-23 03:03:57 -0500 | [diff] [blame] | 100 | |
Sridevi Ramesh | da95c47 | 2020-07-28 06:51:48 -0500 | [diff] [blame] | 101 | ... ELSE Fail msg="Unknown PDR Type is received" |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 102 | |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 103 | Should be equal as strings ${pldm_output['recordHandle']} ${record_handle} |
George Keishing | 409df05 | 2024-01-17 22:36:14 +0530 | [diff] [blame] | 104 | RETURN ${pldm_output['nextRecordHandle']} |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 105 | |
| 106 | Verify SetStateEffecterStates For Effecter States |
| 107 | [Documentation] Verify set state effecter states for given input effecter states. |
Sridevi Ramesh | ca3223a | 2020-03-11 03:58:58 -0500 | [diff] [blame] | 108 | [Arguments] ${effecter_handle} ${count} ${effecter_states} |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 109 | |
| 110 | # Description of argument(s): |
Sridevi Ramesh | ca3223a | 2020-03-11 03:58:58 -0500 | [diff] [blame] | 111 | # ${effecter_handle} A handle that is used to identify and access the effecter (e.g. '1'). |
| 112 | # e.g. '1' is effecter handle 'Boot Progress'. |
| 113 | # '2' is effecter handle 'System Power State'. |
| 114 | # ${count} The number of individual sets of effecter information (e.g. '1'). |
| 115 | # ${effecter_states} (effecterID effecterState). |
| 116 | # e.g. '1 1'. |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 117 | |
| 118 | # Example output: |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 119 | # { |
| 120 | # "Response": "SUCCESS" |
| 121 | # } |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 122 | |
Sridevi Ramesh | ca3223a | 2020-03-11 03:58:58 -0500 | [diff] [blame] | 123 | ${pldm_cmd}= Evaluate $CMD_SETSTATEEFFECTERSTATES % (${effecter_handle}, ${count}, ${effecter_states}) |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 124 | ${pldm_output}= Pldmtool ${pldm_cmd} |
| 125 | Rprint Vars pldm_output |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 126 | Valid Value pldm_output['Response'] ['SUCCESS'] |
Sridevi Ramesh | fc3b07f | 2020-02-27 04:22:24 -0600 | [diff] [blame] | 127 | |
Sridevi Ramesh | fc3b07f | 2020-02-27 04:22:24 -0600 | [diff] [blame] | 128 | Pldmtool Platform Suite Cleanup |
| 129 | [Documentation] Reset BMC at suite cleanup. |
| 130 | |
George Keishing | 64fdf62 | 2020-06-18 02:49:38 -0500 | [diff] [blame] | 131 | Redfish.Login |
George Keishing | 92913a7 | 2022-09-19 12:58:00 -0500 | [diff] [blame] | 132 | Redfish OBMC Reboot (off) |