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