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