blob: e1d3a0d8830b92b9be7b1ddf42151dd3d99cca5f [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 Ramesh039bc762020-03-30 09:59:07 -0500111*** keywords ***
112
113Verify 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 Ramesh92041a32020-04-22 02:29:31 -0500118 # 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 Ramesh039bc762020-03-30 09:59:07 -0500121 # 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 Ramesh961050b2020-11-12 11:04:30 -0600127 ${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}