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 | |
George Keishing | 5431685 | 2023-10-16 14:03:29 +0530 | [diff] [blame] | 11 | Force Tags Pldm_Base |
| 12 | |
Rahul Maheshwari | 4d48857 | 2019-12-10 23:53:05 -0600 | [diff] [blame] | 13 | *** Test Cases *** |
Rahul Maheshwari | 4d48857 | 2019-12-10 23:53:05 -0600 | [diff] [blame] | 14 | Verify Get PLDM Types |
| 15 | [Documentation] Verify supported PLDM types. |
| 16 | [Tags] Verify_Get_PLDM_Types |
| 17 | |
| 18 | ${pldm_output}= Pldmtool base GetPLDMTypes |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 19 | ${count}= Get Length ${pldm_output} |
| 20 | ${cmd_list}= Create List |
| 21 | FOR ${i} IN RANGE ${count} |
| 22 | ${cmd}= Catenate ${pldm_output}[${i}][PLDM Type Code](${pldm_output}[${i}][PLDM Type]) |
| 23 | Append To List ${cmd_list} ${cmd} |
| 24 | END |
| 25 | Valid List cmd_list required_values=${PLDM_SUPPORTED_TYPES} |
Rahul Maheshwari | 4d48857 | 2019-12-10 23:53:05 -0600 | [diff] [blame] | 26 | |
Rahul Maheshwari | 4d48857 | 2019-12-10 23:53:05 -0600 | [diff] [blame] | 27 | Verify Get PLDM Version For Base |
| 28 | [Documentation] Verify supported PLDM version for base type. |
| 29 | [Tags] Verify_Get_PLDM_Version_For_Base |
| 30 | |
| 31 | ${pldm_cmd}= Evaluate $CMD_GETPLDMVERSION % 'base' |
| 32 | ${pldm_output}= Pldmtool ${pldm_cmd} |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 33 | Valid Value pldm_output['Response'] ['${VERSION_BASE['STRING']}'] |
Rahul Maheshwari | 4d48857 | 2019-12-10 23:53:05 -0600 | [diff] [blame] | 34 | |
| 35 | Verify Get PLDM Version For Platform |
| 36 | [Documentation] Verify supported PLDM version for platform type. |
| 37 | [Tags] Verify_Get_PLDM_Version_For_Platform |
| 38 | |
| 39 | ${pldm_cmd}= Evaluate $CMD_GETPLDMVERSION % 'platform' |
| 40 | ${pldm_output}= Pldmtool ${pldm_cmd} |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 41 | Valid Value pldm_output['Response'] ['${VERSION_PLATFORM['STRING']}'] |
Rahul Maheshwari | 4d48857 | 2019-12-10 23:53:05 -0600 | [diff] [blame] | 42 | |
| 43 | |
| 44 | Verify Get PLDM Version For BIOS |
| 45 | [Documentation] Verify supported PLDM version for BIOS type. |
| 46 | [Tags] Verify_Get_PLDM_Version_For_BIOS |
| 47 | |
| 48 | ${pldm_cmd}= Evaluate $CMD_GETPLDMVERSION % 'bios' |
| 49 | ${pldm_output}= Pldmtool ${pldm_cmd} |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 50 | Valid Value pldm_output['Response'] ['${VERSION_BIOS['STRING']}'] |
Rahul Maheshwari | 4d48857 | 2019-12-10 23:53:05 -0600 | [diff] [blame] | 51 | |
| 52 | |
| 53 | Verify Get PLDM Version For FRU |
| 54 | [Documentation] Verify supported PLDM version for FRU type. |
| 55 | [Tags] Verify_Get_PLDM_Version_For_FRU |
| 56 | |
| 57 | ${pldm_cmd}= Evaluate $CMD_GETPLDMVERSION % 'fru' |
| 58 | ${pldm_output}= Pldmtool ${pldm_cmd} |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 59 | Valid Value pldm_output['Response'] ['${VERSION_FRU['STRING']}'] |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 60 | |
Sridevi Ramesh | 92041a3 | 2020-04-22 02:29:31 -0500 | [diff] [blame] | 61 | |
| 62 | Verify Get PLDM Version For OEM |
| 63 | [Documentation] Verify supported PLDM version for oem-ibm type. |
| 64 | [Tags] Verify_Get_PLDM_Version_For_OEM |
| 65 | |
| 66 | ${pldm_cmd}= Evaluate $CMD_GETPLDMVERSION % 'oem-ibm' |
| 67 | ${pldm_output}= Pldmtool ${pldm_cmd} |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 68 | Valid Value pldm_output['Response'] ['${VERSION_OEM['STRING']}'] |
Sridevi Ramesh | 92041a3 | 2020-04-22 02:29:31 -0500 | [diff] [blame] | 69 | |
| 70 | |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 71 | Verify GetTID |
| 72 | [Documentation] Verify GetTID (Terminus ID) response message. |
| 73 | [Tags] Verify_GetTID |
| 74 | |
| 75 | # Example output: |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 76 | # { |
| 77 | # 'Response' : 1 |
| 78 | # } |
Sridevi Ramesh | fe52e40 | 2020-02-05 00:15:24 -0600 | [diff] [blame] | 79 | |
| 80 | ${pldm_output}= Pldmtool base GetTID |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 81 | Valid Value pldm_output['Response'] [1] |
Sridevi Ramesh | 039bc76 | 2020-03-30 09:59:07 -0500 | [diff] [blame] | 82 | |
| 83 | Verify GetPLDMCommands |
| 84 | [Documentation] Verify GetPLDMCommands response message. |
| 85 | [Tags] Verify_GetPLDMCommands |
| 86 | [Template] Verify GetPLDMCommands For PLDM Type |
| 87 | |
| 88 | # pldm_type # expected_pldm_cmds |
| 89 | |
| 90 | '0' ${PLDM_BASE_CMDS} |
| 91 | '2' ${PLDM_PLATFORM_CMDS} |
| 92 | '3' ${PLDM_BIOS_CMDS} |
| 93 | '4' ${PLDM_FRU_CMDS} |
Sridevi Ramesh | 92041a3 | 2020-04-22 02:29:31 -0500 | [diff] [blame] | 94 | '63' ${PLDM_OEM_CMDS} |
Sridevi Ramesh | 039bc76 | 2020-03-30 09:59:07 -0500 | [diff] [blame] | 95 | |
| 96 | *** keywords *** |
| 97 | |
| 98 | Verify GetPLDMCommands For PLDM Type |
| 99 | [Documentation] Verify GetPLDMCommands for given input pldm type with expected pldm cmds. |
| 100 | [Arguments] ${pldm_type} ${expected_pldm_cmds} |
| 101 | |
| 102 | # Description of argument(s): |
Sridevi Ramesh | 92041a3 | 2020-04-22 02:29:31 -0500 | [diff] [blame] | 103 | # pldm_type pldm type (e.g. '0', '2', '3', '4', '63'). |
| 104 | # '0' -> base, '2' -> platform, '3' -> 'bios', '4' -> 'fru' |
| 105 | # '63' -> oem-ibm. |
Sridevi Ramesh | 039bc76 | 2020-03-30 09:59:07 -0500 | [diff] [blame] | 106 | # expected_pldm_cmds expected pldm commands for given pldm type. |
| 107 | |
| 108 | # Example output: |
| 109 | # Supported Commands : 2(GetTID) 3(GetPLDMVersion) 4(GetPLDMTypes) 5(GetPLDMCommands) |
| 110 | |
| 111 | ${pldm_output}= Pldmtool base GetPLDMCommands -t ${pldm_type} |
Sridevi Ramesh | 961050b | 2020-11-12 11:04:30 -0600 | [diff] [blame] | 112 | ${count}= Get Length ${pldm_output} |
| 113 | ${cmd_list}= Create List |
| 114 | FOR ${i} IN RANGE ${count} |
| 115 | ${cmd}= Catenate ${pldm_output}[${i}][PLDM Command Code](${pldm_output}[${i}][PLDM Command]) |
| 116 | Append To List ${cmd_list} ${cmd} |
| 117 | END |
| 118 | Valid List cmd_list required_values=${expected_pldm_cmds} |