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 | 039bc76 | 2020-03-30 09:59:07 -0500 | [diff] [blame] | 111 | *** keywords *** |
| 112 | |
| 113 | Verify GetPLDMCommands For PLDM Type |
| 114 | [Documentation] Verify GetPLDMCommands for given input pldm type with expected pldm cmds. |
| 115 | [Arguments] ${pldm_type} ${expected_pldm_cmds} |
| 116 | |
| 117 | # Description of argument(s): |
Sridevi Ramesh | 92041a3 | 2020-04-22 02:29:31 -0500 | [diff] [blame] | 118 | # pldm_type pldm type (e.g. '0', '2', '3', '4', '63'). |
| 119 | # '0' -> base, '2' -> platform, '3' -> 'bios', '4' -> 'fru' |
| 120 | # '63' -> oem-ibm. |
Sridevi Ramesh | 039bc76 | 2020-03-30 09:59:07 -0500 | [diff] [blame] | 121 | # expected_pldm_cmds expected pldm commands for given pldm type. |
| 122 | |
| 123 | # Example output: |
| 124 | # Supported Commands : 2(GetTID) 3(GetPLDMVersion) 4(GetPLDMTypes) 5(GetPLDMCommands) |
| 125 | |
| 126 | ${pldm_output}= Pldmtool base GetPLDMCommands -t ${pldm_type} |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 127 | ${count}= Get Length ${pldm_output} |
| 128 | ${cmd_list}= Create List |
| 129 | FOR ${i} IN RANGE ${count} |
| 130 | ${cmd}= Catenate ${pldm_output}[${i}][PLDM Command Code](${pldm_output}[${i}][PLDM Command]) |
| 131 | Append To List ${cmd_list} ${cmd} |
| 132 | END |
| 133 | Valid List cmd_list required_values=${expected_pldm_cmds} |