blob: 73af849a668ce68e88640cb42a560102449dc787 [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
Sridevi Ramesh206173d2016-08-16 05:41:40 -05002Documentation This suite is for Verifying BMC & BIOS version exposed part
3... of system inventory
Chris Austenb29d2e82016-06-07 12:25:35 -05004
5Resource ../lib/rest_client.robot
George Keishingd55a4be2016-08-26 03:28:17 -05006Resource ../lib/openbmc_ffdc.robot
George Keishingab5157b2017-02-09 12:24:25 -06007Resource ../lib/connection_client.robot
George Keishing0a1044c2017-08-09 09:50:51 -05008Resource ../lib/code_update_utils.robot
Gunnar Millseac1af22016-11-14 15:30:09 -06009Test Teardown FFDC On Test Case Fail
Chris Austenb29d2e82016-06-07 12:25:35 -050010
11
George Keishingfe4ebd22017-09-12 06:05:22 -050012*** Variables ***
13
14${BMC_SW_PATH} ${HOST_INVENTORY_URI}system/chassis/motherboard/boxelder/bmc
15${HOST_SW_PATH} ${HOST_INVENTORY_URI}system/chassis
16
Chris Austenb29d2e82016-06-07 12:25:35 -050017*** Test Cases ***
George Keishingab5157b2017-02-09 12:24:25 -060018
George Keishing0a1044c2017-08-09 09:50:51 -050019BMC Software Version
20 [Documentation] Verify BMC version and activation status.
21 [Tags] BMC_Software_Version
22 [Template] Verify Software Version
23
George Keishingfe4ebd22017-09-12 06:05:22 -050024 # Software Purpose
George Keishing0a1044c2017-08-09 09:50:51 -050025 ${VERSION_PURPOSE_BMC}
26
George Keishingfe4ebd22017-09-12 06:05:22 -050027
28BMC Software Activation Association
29 [Documentation] Verify BMC association.
30 [Tags] BMC_Software_Activation_Association
31 [Template] Verify Software Activation Association
32
33 # Software Purpose Association path
34 ${VERSION_PURPOSE_BMC} ${BMC_SW_PATH}
35
36
George Keishing0a1044c2017-08-09 09:50:51 -050037Host Software Version
38 [Documentation] Verify host version and activation status.
39 [Tags] Host_Software_Version
40 [Template] Verify Software Version
41
George Keishingfe4ebd22017-09-12 06:05:22 -050042 # Software Purpose
George Keishing0a1044c2017-08-09 09:50:51 -050043 ${VERSION_PURPOSE_HOST}
George Keishingab5157b2017-02-09 12:24:25 -060044
45
George Keishingfe4ebd22017-09-12 06:05:22 -050046Host Software Activation Association
47 [Documentation] Verify Host association.
48 [Tags] Host_Software_Activation_Association
49 [Template] Verify Software Activation Association
50
51 # Software Purpose Association path
52 ${VERSION_PURPOSE_HOST} ${HOST_SW_PATH}
53
54
George Keishingab5157b2017-02-09 12:24:25 -060055*** Keywords ***
56
George Keishingfe4ebd22017-09-12 06:05:22 -050057Verify Software Activation Association
58 [Documentation] Verify software activation association.
59 [Arguments] ${software_purpose} ${assoiation_path}
60
61 # Description of argument(s):
62 # software_purpose BMC or host software purpose.
63 # assoiation_path BMC or host inventory path.
64
65 # Example:
66 # "/xyz/openbmc_project/software/a0d9ba0d": {
67 # "Activation": "xyz.openbmc_project.Software.Activation.Activations.Active",
68 # "Path": "",
69 # "Priority": 0,
70 # "Purpose": "xyz.openbmc_project.Software.Version.VersionPurpose.BMC",
71 # "RequestedActivation": "xyz.openbmc_project.Software.Activation.RequestedActivations.None",
72 # "Version": "v1.99.9-143-g69cab69",
73 # "associations": [
74 # [
75 # "inventory",
76 # "activation",
77 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc"
78 # ]
79 # ]
80 # },
81 # "/xyz/openbmc_project/software/a0d9ba0d/inventory": {
82 # "endpoints": [
83 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc"
84 # ]
85 # },
86
87 ${obj_path_list}= Get Software Objects ${software_purpose}
88
89 : FOR ${index} IN @{obj_path_list}
90 \ Verify Inventory Association ${index} ${assoiation_path}
91
92
93Verify Inventory Association
94 [Documentation] Verify software inventory association.
95 [Arguments] ${software_path} ${assoiation_path}
96
97 # Description of argument(s):
98 # software_path BMC or host software id.
99 # assoiation_path BMC or host inventory path.
100
101 # Example:
102 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/boxelder/bmc/activation": {
103 # "endpoints": [
104 # "/xyz/openbmc_project/software/e42627b5",
105 # "/xyz/openbmc_project/software/a0d9ba0d"
106 # ]
107 # },
108
109 ${sw_attr_data}= Read Attribute ${software_path} associations
110 List Should Contain Value @{sw_attr_data} ${assoiation_path}
111
112 # Verify the inventory path in software manager entry.
113 ${sw_endpoint_data}= Read Attribute
114 ... ${software_path}${/}inventory endpoints
115 List Should Contain Value ${sw_endpoint_data} ${assoiation_path}
116
117 # Verify the inventory path.
118 ${inv_endpoint_data}= Read Attribute
119 ... ${assoiation_path}${/}activation endpoints
120 List Should Contain Value ${inv_endpoint_data} ${software_path}
121
122
George Keishing0a1044c2017-08-09 09:50:51 -0500123Verify Software Version
124 [Documentation] Verify version and activation status.
125 [Arguments] ${software_purpose}
George Keishingab5157b2017-02-09 12:24:25 -0600126
George Keishing0a1044c2017-08-09 09:50:51 -0500127 # Description of argument(s):
128 # software_purpose BMC or host software purpose.
129
130 # Example:
131 # /xyz/openbmc_project/software/list
132 # [
133 # "/xyz/openbmc_project/software/2f974579",
134 # "/xyz/openbmc_project/software/136cf504"
135 # ]
136 ${obj_list}= Get Software Objects ${software_purpose}
137 : FOR ${index} IN @{obj_list}
138 \ ${resp}= Get Host Software Property ${index}
139 \ Verify Software Properties ${resp} ${software_purpose}
George Keishing81ae45b2017-09-28 14:05:04 -0500140 \ Run Keyword If '${software_purpose}' == '${VERSION_PURPOSE_BMC}'
141 ... Check BMC Version ${index} ${resp["Version"]}
George Keishingab5157b2017-02-09 12:24:25 -0600142
143
144Verify Software Properties
George Keishing0a1044c2017-08-09 09:50:51 -0500145 [Documentation] Verify the software object properties.
146 [Arguments] ${software_property} ${software_purpose}
George Keishingab5157b2017-02-09 12:24:25 -0600147
George Keishing0a1044c2017-08-09 09:50:51 -0500148 # Description of argument(s):
149 # software_property JSON response data.
150 # software_purpose BMC or host software purpose
151 # (e.g. "xyz.openbmc_project.Software.Version.VersionPurpose.BMC"
152 # "xyz.openbmc_project.Software.Version.VersionPurpose.Host").
153
154 Check Activation Status ${software_property["Activation"]}
George Keishingab5157b2017-02-09 12:24:25 -0600155
156
157Check BMC Version
158 [Documentation] Get BMC version from /etc/os-release and compare.
George Keishing81ae45b2017-09-28 14:05:04 -0500159 [Arguments] ${software_object} ${version}
George Keishing0a1044c2017-08-09 09:50:51 -0500160
161 # Description of argument(s):
George Keishing81ae45b2017-09-28 14:05:04 -0500162 # software_object Software object path.
163 # version Software version (e.g. "v1.99.2-107-g2be34d2-dirty")
164
165 ${min_value}= Get Least Value Priority Image ${VERSION_PURPOSE_BMC}
166 ${priority_value}= Read Software Attribute ${software_object} Priority
167
168 Return From Keyword If ${priority_value} != ${min_value}
George Keishing0a1044c2017-08-09 09:50:51 -0500169
George Keishingab5157b2017-02-09 12:24:25 -0600170 Open Connection And Log In
171 ${cmd}= Set Variable grep ^VERSION_ID= /etc/os-release | cut -f 2 -d '='
172 ${output}= Execute Command On BMC ${cmd}
173 Should Be Equal As Strings ${version} ${output[1:-1]}
174
175
176Check Activation Status
177 [Documentation] Check if software state is "Active".
178 [Arguments] ${status}
George Keishing0a1044c2017-08-09 09:50:51 -0500179
180 # Description of argument(s):
George Keishingab5157b2017-02-09 12:24:25 -0600181 # status Activation status
182 # (e.g. "xyz.openbmc_project.Software.Activation.Activations.Active")
183 Should Be Equal As Strings ${ACTIVE} ${status}