blob: 67229afe5d144bf39c60dc7b9283a8bb84eb6a15 [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
George Keishing54316852023-10-16 14:03:29 +053011Force Tags Pldm_Base
12
Rahul Maheshwari4d488572019-12-10 23:53:05 -060013*** Test Cases ***
Rahul Maheshwari4d488572019-12-10 23:53:05 -060014Verify Get PLDM Types
15 [Documentation] Verify supported PLDM types.
16 [Tags] Verify_Get_PLDM_Types
17
18 ${pldm_output}= Pldmtool base GetPLDMTypes
Sridevi Ramesh961050b2020-11-12 11:04:30 -060019 ${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 Maheshwari4d488572019-12-10 23:53:05 -060026
Rahul Maheshwari4d488572019-12-10 23:53:05 -060027Verify 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 Ramesh961050b2020-11-12 11:04:30 -060033 Valid Value pldm_output['Response'] ['${VERSION_BASE['STRING']}']
Rahul Maheshwari4d488572019-12-10 23:53:05 -060034
35Verify 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 Ramesh961050b2020-11-12 11:04:30 -060041 Valid Value pldm_output['Response'] ['${VERSION_PLATFORM['STRING']}']
Rahul Maheshwari4d488572019-12-10 23:53:05 -060042
43
44Verify 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 Ramesh961050b2020-11-12 11:04:30 -060050 Valid Value pldm_output['Response'] ['${VERSION_BIOS['STRING']}']
Rahul Maheshwari4d488572019-12-10 23:53:05 -060051
52
53Verify 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 Ramesh961050b2020-11-12 11:04:30 -060059 Valid Value pldm_output['Response'] ['${VERSION_FRU['STRING']}']
Sridevi Rameshfe52e402020-02-05 00:15:24 -060060
Sridevi Ramesh92041a32020-04-22 02:29:31 -050061
62Verify 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 Ramesh961050b2020-11-12 11:04:30 -060068 Valid Value pldm_output['Response'] ['${VERSION_OEM['STRING']}']
Sridevi Ramesh92041a32020-04-22 02:29:31 -050069
70
Sridevi Rameshfe52e402020-02-05 00:15:24 -060071Verify GetTID
72 [Documentation] Verify GetTID (Terminus ID) response message.
73 [Tags] Verify_GetTID
74
75 # Example output:
Sridevi Ramesh961050b2020-11-12 11:04:30 -060076 # {
77 # 'Response' : 1
78 # }
Sridevi Rameshfe52e402020-02-05 00:15:24 -060079
80 ${pldm_output}= Pldmtool base GetTID
Sridevi Ramesh961050b2020-11-12 11:04:30 -060081 Valid Value pldm_output['Response'] [1]
Sridevi Ramesh039bc762020-03-30 09:59:07 -050082
83Verify 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 Ramesh92041a32020-04-22 02:29:31 -050094 '63' ${PLDM_OEM_CMDS}
Sridevi Ramesh039bc762020-03-30 09:59:07 -050095
96*** keywords ***
97
98Verify 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 Ramesh92041a32020-04-22 02:29:31 -0500103 # 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 Ramesh039bc762020-03-30 09:59:07 -0500106 # 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 Ramesh961050b2020-11-12 11:04:30 -0600112 ${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}