Rahul Maheshwari | 4d48857 | 2019-12-10 23:53:05 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | |
| 3 | Documentation Module to test PLDM base commands. |
| 4 | Library ../lib/pldm_utils.py |
| 5 | Variables ../data/pldm_variables.py |
| 6 | Resource ../lib/openbmc_ffdc.robot |
| 7 | |
| 8 | Test Setup Printn |
| 9 | Test Teardown FFDC On Test Case Fail |
| 10 | |
Matt Fischer | 6fb70d9 | 2023-10-24 19:06:33 -0600 | [diff] [blame] | 11 | Test Tags Pldm_Base |
George Keishing | 5431685 | 2023-10-16 14:03:29 +0530 | [diff] [blame] | 12 | |
Rahul Maheshwari | 4d48857 | 2019-12-10 23:53:05 -0600 | [diff] [blame] | 13 | *** Test Cases *** |
Sridevi Ramesh | 61a59a8 | 2025-01-09 04:08:47 -0600 | [diff] [blame] | 14 | |
Rahul Maheshwari | 4d48857 | 2019-12-10 23:53:05 -0600 | [diff] [blame] | 15 | Verify Get PLDM Types |
| 16 | [Documentation] Verify supported PLDM types. |
| 17 | [Tags] Verify_Get_PLDM_Types |
| 18 | |
| 19 | ${pldm_output}= Pldmtool base GetPLDMTypes |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 20 | ${count}= Get Length ${pldm_output} |
| 21 | ${cmd_list}= Create List |
| 22 | FOR ${i} IN RANGE ${count} |
| 23 | ${cmd}= Catenate ${pldm_output}[${i}][PLDM Type Code](${pldm_output}[${i}][PLDM Type]) |
| 24 | Append To List ${cmd_list} ${cmd} |
| 25 | END |
| 26 | Valid List cmd_list required_values=${PLDM_SUPPORTED_TYPES} |
Rahul Maheshwari | 4d48857 | 2019-12-10 23:53:05 -0600 | [diff] [blame] | 27 | |
Rahul Maheshwari | 4d48857 | 2019-12-10 23:53:05 -0600 | [diff] [blame] | 28 | Verify Get PLDM Version For Base |
| 29 | [Documentation] Verify supported PLDM version for base type. |
| 30 | [Tags] Verify_Get_PLDM_Version_For_Base |
| 31 | |
| 32 | ${pldm_cmd}= Evaluate $CMD_GETPLDMVERSION % 'base' |
| 33 | ${pldm_output}= Pldmtool ${pldm_cmd} |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 34 | Valid Value pldm_output['Response'] ['${VERSION_BASE['STRING']}'] |
Rahul Maheshwari | 4d48857 | 2019-12-10 23:53:05 -0600 | [diff] [blame] | 35 | |
| 36 | Verify Get PLDM Version For Platform |
| 37 | [Documentation] Verify supported PLDM version for platform type. |
| 38 | [Tags] Verify_Get_PLDM_Version_For_Platform |
| 39 | |
| 40 | ${pldm_cmd}= Evaluate $CMD_GETPLDMVERSION % 'platform' |
| 41 | ${pldm_output}= Pldmtool ${pldm_cmd} |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 42 | Valid Value pldm_output['Response'] ['${VERSION_PLATFORM['STRING']}'] |
Rahul Maheshwari | 4d48857 | 2019-12-10 23:53:05 -0600 | [diff] [blame] | 43 | |
| 44 | |
| 45 | Verify Get PLDM Version For BIOS |
| 46 | [Documentation] Verify supported PLDM version for BIOS type. |
| 47 | [Tags] Verify_Get_PLDM_Version_For_BIOS |
| 48 | |
| 49 | ${pldm_cmd}= Evaluate $CMD_GETPLDMVERSION % 'bios' |
| 50 | ${pldm_output}= Pldmtool ${pldm_cmd} |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 51 | Valid Value pldm_output['Response'] ['${VERSION_BIOS['STRING']}'] |
Rahul Maheshwari | 4d48857 | 2019-12-10 23:53:05 -0600 | [diff] [blame] | 52 | |
| 53 | |
| 54 | Verify Get PLDM Version For FRU |
| 55 | [Documentation] Verify supported PLDM version for FRU type. |
| 56 | [Tags] Verify_Get_PLDM_Version_For_FRU |
| 57 | |
| 58 | ${pldm_cmd}= Evaluate $CMD_GETPLDMVERSION % 'fru' |
| 59 | ${pldm_output}= Pldmtool ${pldm_cmd} |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 60 | Valid Value pldm_output['Response'] ['${VERSION_FRU['STRING']}'] |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 61 | |
Sridevi Ramesh | 92041a3 | 2020-04-22 02:29:31 -0500 | [diff] [blame] | 62 | |
| 63 | Verify Get PLDM Version For OEM |
| 64 | [Documentation] Verify supported PLDM version for oem-ibm type. |
| 65 | [Tags] Verify_Get_PLDM_Version_For_OEM |
| 66 | |
| 67 | ${pldm_cmd}= Evaluate $CMD_GETPLDMVERSION % 'oem-ibm' |
| 68 | ${pldm_output}= Pldmtool ${pldm_cmd} |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 69 | Valid Value pldm_output['Response'] ['${VERSION_OEM['STRING']}'] |
Sridevi Ramesh | 92041a3 | 2020-04-22 02:29:31 -0500 | [diff] [blame] | 70 | |
| 71 | |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 72 | Verify GetTID |
| 73 | [Documentation] Verify GetTID (Terminus ID) response message. |
| 74 | [Tags] Verify_GetTID |
| 75 | |
| 76 | # Example output: |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 77 | # { |
| 78 | # 'Response' : 1 |
| 79 | # } |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 80 | |
| 81 | ${pldm_output}= Pldmtool base GetTID |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 82 | Valid Value pldm_output['Response'] [1] |
Sridevi Ramesh | 039bc76 | 2020-03-30 09:59:07 -0500 | [diff] [blame] | 83 | |
| 84 | Verify GetPLDMCommands |
| 85 | [Documentation] Verify GetPLDMCommands response message. |
| 86 | [Tags] Verify_GetPLDMCommands |
| 87 | [Template] Verify GetPLDMCommands For PLDM Type |
| 88 | |
| 89 | # pldm_type # expected_pldm_cmds |
| 90 | |
| 91 | '0' ${PLDM_BASE_CMDS} |
| 92 | '2' ${PLDM_PLATFORM_CMDS} |
| 93 | '3' ${PLDM_BIOS_CMDS} |
| 94 | '4' ${PLDM_FRU_CMDS} |
Sridevi Ramesh | 92041a3 | 2020-04-22 02:29:31 -0500 | [diff] [blame] | 95 | '63' ${PLDM_OEM_CMDS} |
Sridevi Ramesh | 039bc76 | 2020-03-30 09:59:07 -0500 | [diff] [blame] | 96 | |
Sridevi Ramesh | 61a59a8 | 2025-01-09 04:08:47 -0600 | [diff] [blame] | 97 | |
| 98 | Verify Verbose Flag For PLDM Subsystem Commands |
| 99 | [Documentation] Verify verbose flag for PLDM subsystem commands. |
| 100 | [Tags] Verify_Verbose_Flag_For_PLDM_Subsystem_Commands |
| 101 | |
| 102 | ${pldm_output}= Pldmtool base GetPLDMTypes -v |
| 103 | Should Contain ${pldm_output} pldmtool: Tx: |
| 104 | Should Contain ${pldm_output} pldmtool: Rx: |
| 105 | |
| 106 | ${pldm_output}= Pldmtool bios GetDateTime -v |
| 107 | Should Contain ${pldm_output} pldmtool: Tx: |
| 108 | Should Contain ${pldm_output} pldmtool: Rx: |
| 109 | |
| 110 | |
Sridevi Ramesh | 78def93 | 2025-01-13 00:47:44 -0600 | [diff] [blame^] | 111 | Verify Response For PLDM Raw Commands |
| 112 | [Documentation] Verify response for PLDM raw commands. |
| 113 | [Tags] Verify_Response_For_PLDM_Raw_Commands |
Sridevi Ramesh | fb89bec | 2025-01-10 04:14:40 -0600 | [diff] [blame] | 114 | |
| 115 | # Example output format: |
| 116 | # pldmtool raw -d 0x80 0x00 0x04 |
| 117 | # pldmtool: Tx: 80 00 04 |
| 118 | # pldmtool: Rx: 00 00 04 00 1d 00 00 00 00 00 00 80 |
| 119 | |
| 120 | ${pldm_output}= Pldmtool ${PLDM_GET_PLDM_TYPES_RAW_CMD} |
| 121 | Should Contain ${pldm_output} ${PLDM_GET_PLDM_TYPES_RAW_CMD_OUTPUT} |
| 122 | |
| 123 | |
Sridevi Ramesh | 78def93 | 2025-01-13 00:47:44 -0600 | [diff] [blame^] | 124 | Verify Verbose Flag For PLDM Raw Command |
| 125 | [Documentation] Verify PLDM raw command with verbose flag, |
| 126 | [Tags] Verify_Verbose_Flag_For_PLDM_Raw_Command |
Sridevi Ramesh | fb89bec | 2025-01-10 04:14:40 -0600 | [diff] [blame] | 127 | |
| 128 | # Example output format: |
| 129 | # pldmtool raw -d 0x80 0x00 0x04 -v |
| 130 | # pldmtool: Tx: 80 00 04 |
| 131 | # pldmtool: Rx: 00 00 04 00 1d 00 00 00 00 00 00 80 |
| 132 | |
| 133 | ${pldm_output}= Pldmtool ${PLDM_GET_PLDM_TYPES_RAW_CMD} -v |
| 134 | Should Contain ${pldm_output} ${PLDM_GET_PLDM_TYPES_RAW_CMD_OUTPUT} |
| 135 | |
| 136 | |
Sridevi Ramesh | 78def93 | 2025-01-13 00:47:44 -0600 | [diff] [blame^] | 137 | Verify Verbose Flag For Incorrect PLDM Raw Command |
| 138 | [Documentation] Verify incorrect PLDM raw command with verbose flag, |
| 139 | [Tags] Verify_Verbose_Flag_For_Incorrect_PLDM_Raw_Command |
| 140 | |
| 141 | # Example output format: |
| 142 | # pldmtool raw -d 0x80 0x00 0x00 -v |
| 143 | # pldmtool: Tx: 80 00 04 |
| 144 | # pldmtool: Rx: 00 00 00 05 |
| 145 | |
| 146 | ${pldm_output}= Pldmtool ${PLDM_RAW_CMD_INVALID} -v |
| 147 | Should Contain ${pldm_output} ${PLDM_RAW_CMD_INVALID_OUTPUT} |
| 148 | |
| 149 | |
Sridevi Ramesh | 039bc76 | 2020-03-30 09:59:07 -0500 | [diff] [blame] | 150 | *** keywords *** |
| 151 | |
| 152 | Verify GetPLDMCommands For PLDM Type |
| 153 | [Documentation] Verify GetPLDMCommands for given input pldm type with expected pldm cmds. |
| 154 | [Arguments] ${pldm_type} ${expected_pldm_cmds} |
| 155 | |
| 156 | # Description of argument(s): |
Sridevi Ramesh | 92041a3 | 2020-04-22 02:29:31 -0500 | [diff] [blame] | 157 | # pldm_type pldm type (e.g. '0', '2', '3', '4', '63'). |
| 158 | # '0' -> base, '2' -> platform, '3' -> 'bios', '4' -> 'fru' |
| 159 | # '63' -> oem-ibm. |
Sridevi Ramesh | 039bc76 | 2020-03-30 09:59:07 -0500 | [diff] [blame] | 160 | # expected_pldm_cmds expected pldm commands for given pldm type. |
| 161 | |
| 162 | # Example output: |
| 163 | # Supported Commands : 2(GetTID) 3(GetPLDMVersion) 4(GetPLDMTypes) 5(GetPLDMCommands) |
| 164 | |
| 165 | ${pldm_output}= Pldmtool base GetPLDMCommands -t ${pldm_type} |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 166 | ${count}= Get Length ${pldm_output} |
| 167 | ${cmd_list}= Create List |
| 168 | FOR ${i} IN RANGE ${count} |
| 169 | ${cmd}= Catenate ${pldm_output}[${i}][PLDM Command Code](${pldm_output}[${i}][PLDM Command]) |
| 170 | Append To List ${cmd_list} ${cmd} |
| 171 | END |
| 172 | Valid List cmd_list required_values=${expected_pldm_cmds} |