blob: 30cccebd8fe05f26601523fe4df1201f71385b87 [file] [log] [blame]
Rahul Maheshwari4d488572019-12-10 23:53:05 -06001*** Settings ***
2
3Documentation Module to test PLDM base commands.
4Library ../lib/pldm_utils.py
5Variables ../data/pldm_variables.py
6Resource ../lib/openbmc_ffdc.robot
7
8Test Setup Printn
9Test Teardown FFDC On Test Case Fail
10
Matt Fischer6fb70d92023-10-24 19:06:33 -060011Test Tags Pldm_Base
George Keishing54316852023-10-16 14:03:29 +053012
Rahul Maheshwari4d488572019-12-10 23:53:05 -060013*** Test Cases ***
Sridevi Ramesh61a59a82025-01-09 04:08:47 -060014
Rahul Maheshwari4d488572019-12-10 23:53:05 -060015Verify Get PLDM Types
16 [Documentation] Verify supported PLDM types.
17 [Tags] Verify_Get_PLDM_Types
18
19 ${pldm_output}= Pldmtool base GetPLDMTypes
Sridevi Ramesh961050b2020-11-12 11:04:30 -060020 ${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 Maheshwari4d488572019-12-10 23:53:05 -060027
Rahul Maheshwari4d488572019-12-10 23:53:05 -060028Verify 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 Ramesh961050b2020-11-12 11:04:30 -060034 Valid Value pldm_output['Response'] ['${VERSION_BASE['STRING']}']
Rahul Maheshwari4d488572019-12-10 23:53:05 -060035
36Verify 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 Ramesh961050b2020-11-12 11:04:30 -060042 Valid Value pldm_output['Response'] ['${VERSION_PLATFORM['STRING']}']
Rahul Maheshwari4d488572019-12-10 23:53:05 -060043
44
45Verify 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 Ramesh961050b2020-11-12 11:04:30 -060051 Valid Value pldm_output['Response'] ['${VERSION_BIOS['STRING']}']
Rahul Maheshwari4d488572019-12-10 23:53:05 -060052
53
54Verify 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 Ramesh961050b2020-11-12 11:04:30 -060060 Valid Value pldm_output['Response'] ['${VERSION_FRU['STRING']}']
Sridevi Rameshfe52e402020-02-05 00:15:24 -060061
Sridevi Ramesh92041a32020-04-22 02:29:31 -050062
63Verify 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 Ramesh961050b2020-11-12 11:04:30 -060069 Valid Value pldm_output['Response'] ['${VERSION_OEM['STRING']}']
Sridevi Ramesh92041a32020-04-22 02:29:31 -050070
71
Sridevi Rameshfe52e402020-02-05 00:15:24 -060072Verify GetTID
73 [Documentation] Verify GetTID (Terminus ID) response message.
74 [Tags] Verify_GetTID
75
76 # Example output:
Sridevi Ramesh961050b2020-11-12 11:04:30 -060077 # {
78 # 'Response' : 1
79 # }
Sridevi Rameshfe52e402020-02-05 00:15:24 -060080
81 ${pldm_output}= Pldmtool base GetTID
Sridevi Ramesh961050b2020-11-12 11:04:30 -060082 Valid Value pldm_output['Response'] [1]
Sridevi Ramesh039bc762020-03-30 09:59:07 -050083
84Verify 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 Ramesh92041a32020-04-22 02:29:31 -050095 '63' ${PLDM_OEM_CMDS}
Sridevi Ramesh039bc762020-03-30 09:59:07 -050096
Sridevi Ramesh61a59a82025-01-09 04:08:47 -060097
98Verify 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 Ramesh78def932025-01-13 00:47:44 -0600111Verify Response For PLDM Raw Commands
112 [Documentation] Verify response for PLDM raw commands.
113 [Tags] Verify_Response_For_PLDM_Raw_Commands
Sridevi Rameshfb89bec2025-01-10 04:14:40 -0600114
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 Ramesh78def932025-01-13 00:47:44 -0600124Verify 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 Rameshfb89bec2025-01-10 04:14:40 -0600127
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 Ramesh78def932025-01-13 00:47:44 -0600137Verify 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 Ramesh039bc762020-03-30 09:59:07 -0500150*** keywords ***
151
152Verify 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 Ramesh92041a32020-04-22 02:29:31 -0500157 # 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 Ramesh039bc762020-03-30 09:59:07 -0500160 # 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 Ramesh961050b2020-11-12 11:04:30 -0600166 ${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}