blob: a23b5b8f6947904579bd78f3da48565677e8ef02 [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
Rahul Maheshwari4d488572019-12-10 23:53:05 -060011*** Test Cases ***
Rahul Maheshwari4d488572019-12-10 23:53:05 -060012Verify Get PLDM Types
13 [Documentation] Verify supported PLDM types.
14 [Tags] Verify_Get_PLDM_Types
15
16 ${pldm_output}= Pldmtool base GetPLDMTypes
Sridevi Ramesh961050b2020-11-12 11:04:30 -060017 ${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 Maheshwari4d488572019-12-10 23:53:05 -060024
Rahul Maheshwari4d488572019-12-10 23:53:05 -060025Verify 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 Ramesh961050b2020-11-12 11:04:30 -060031 Valid Value pldm_output['Response'] ['${VERSION_BASE['STRING']}']
Rahul Maheshwari4d488572019-12-10 23:53:05 -060032
33Verify 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 Ramesh961050b2020-11-12 11:04:30 -060039 Valid Value pldm_output['Response'] ['${VERSION_PLATFORM['STRING']}']
Rahul Maheshwari4d488572019-12-10 23:53:05 -060040
41
42Verify 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 Ramesh961050b2020-11-12 11:04:30 -060048 Valid Value pldm_output['Response'] ['${VERSION_BIOS['STRING']}']
Rahul Maheshwari4d488572019-12-10 23:53:05 -060049
50
51Verify 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 Ramesh961050b2020-11-12 11:04:30 -060057 Valid Value pldm_output['Response'] ['${VERSION_FRU['STRING']}']
Sridevi Rameshfe52e402020-02-05 00:15:24 -060058
Sridevi Ramesh92041a32020-04-22 02:29:31 -050059
60Verify 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 Ramesh961050b2020-11-12 11:04:30 -060066 Valid Value pldm_output['Response'] ['${VERSION_OEM['STRING']}']
Sridevi Ramesh92041a32020-04-22 02:29:31 -050067
68
Sridevi Rameshfe52e402020-02-05 00:15:24 -060069Verify GetTID
70 [Documentation] Verify GetTID (Terminus ID) response message.
71 [Tags] Verify_GetTID
72
73 # Example output:
Sridevi Ramesh961050b2020-11-12 11:04:30 -060074 # {
75 # 'Response' : 1
76 # }
Sridevi Rameshfe52e402020-02-05 00:15:24 -060077
78 ${pldm_output}= Pldmtool base GetTID
Sridevi Ramesh961050b2020-11-12 11:04:30 -060079 Valid Value pldm_output['Response'] [1]
Sridevi Ramesh039bc762020-03-30 09:59:07 -050080
81Verify 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 Ramesh92041a32020-04-22 02:29:31 -050092 '63' ${PLDM_OEM_CMDS}
Sridevi Ramesh039bc762020-03-30 09:59:07 -050093
94*** keywords ***
95
96Verify 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 Ramesh92041a32020-04-22 02:29:31 -0500101 # 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 Ramesh039bc762020-03-30 09:59:07 -0500104 # 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 Ramesh961050b2020-11-12 11:04:30 -0600110 ${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}