Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
Sridevi Ramesh | 206173d | 2016-08-16 05:41:40 -0500 | [diff] [blame] | 2 | Documentation This suite is for Verifying BMC & BIOS version exposed part |
| 3 | ... of system inventory |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 4 | |
| 5 | Resource ../lib/rest_client.robot |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 6 | Resource ../lib/openbmc_ffdc.robot |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 7 | Resource ../lib/connection_client.robot |
George Keishing | 0a1044c | 2017-08-09 09:50:51 -0500 | [diff] [blame] | 8 | Resource ../lib/code_update_utils.robot |
Gunnar Mills | eac1af2 | 2016-11-14 15:30:09 -0600 | [diff] [blame] | 9 | Test Teardown FFDC On Test Case Fail |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 10 | |
| 11 | |
George Keishing | fe4ebd2 | 2017-09-12 06:05:22 -0500 | [diff] [blame] | 12 | *** 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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 17 | *** Test Cases *** |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 18 | |
George Keishing | 0a1044c | 2017-08-09 09:50:51 -0500 | [diff] [blame] | 19 | BMC Software Version |
| 20 | [Documentation] Verify BMC version and activation status. |
| 21 | [Tags] BMC_Software_Version |
| 22 | [Template] Verify Software Version |
| 23 | |
George Keishing | fe4ebd2 | 2017-09-12 06:05:22 -0500 | [diff] [blame] | 24 | # Software Purpose |
George Keishing | 0a1044c | 2017-08-09 09:50:51 -0500 | [diff] [blame] | 25 | ${VERSION_PURPOSE_BMC} |
| 26 | |
George Keishing | fe4ebd2 | 2017-09-12 06:05:22 -0500 | [diff] [blame] | 27 | |
| 28 | BMC 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 Keishing | 0a1044c | 2017-08-09 09:50:51 -0500 | [diff] [blame] | 37 | Host Software Version |
| 38 | [Documentation] Verify host version and activation status. |
| 39 | [Tags] Host_Software_Version |
| 40 | [Template] Verify Software Version |
| 41 | |
George Keishing | fe4ebd2 | 2017-09-12 06:05:22 -0500 | [diff] [blame] | 42 | # Software Purpose |
George Keishing | 0a1044c | 2017-08-09 09:50:51 -0500 | [diff] [blame] | 43 | ${VERSION_PURPOSE_HOST} |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 44 | |
| 45 | |
George Keishing | fe4ebd2 | 2017-09-12 06:05:22 -0500 | [diff] [blame] | 46 | Host 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 Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 55 | *** Keywords *** |
| 56 | |
George Keishing | fe4ebd2 | 2017-09-12 06:05:22 -0500 | [diff] [blame] | 57 | Verify 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 | |
| 93 | Verify 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 Keishing | 0a1044c | 2017-08-09 09:50:51 -0500 | [diff] [blame] | 123 | Verify Software Version |
| 124 | [Documentation] Verify version and activation status. |
| 125 | [Arguments] ${software_purpose} |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 126 | |
George Keishing | 0a1044c | 2017-08-09 09:50:51 -0500 | [diff] [blame] | 127 | # 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 Keishing | 81ae45b | 2017-09-28 14:05:04 -0500 | [diff] [blame] | 140 | \ Run Keyword If '${software_purpose}' == '${VERSION_PURPOSE_BMC}' |
| 141 | ... Check BMC Version ${index} ${resp["Version"]} |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 142 | |
| 143 | |
| 144 | Verify Software Properties |
George Keishing | 0a1044c | 2017-08-09 09:50:51 -0500 | [diff] [blame] | 145 | [Documentation] Verify the software object properties. |
| 146 | [Arguments] ${software_property} ${software_purpose} |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 147 | |
George Keishing | 0a1044c | 2017-08-09 09:50:51 -0500 | [diff] [blame] | 148 | # 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 Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 155 | |
| 156 | |
| 157 | Check BMC Version |
| 158 | [Documentation] Get BMC version from /etc/os-release and compare. |
George Keishing | 81ae45b | 2017-09-28 14:05:04 -0500 | [diff] [blame] | 159 | [Arguments] ${software_object} ${version} |
George Keishing | 0a1044c | 2017-08-09 09:50:51 -0500 | [diff] [blame] | 160 | |
| 161 | # Description of argument(s): |
George Keishing | 81ae45b | 2017-09-28 14:05:04 -0500 | [diff] [blame] | 162 | # 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 Keishing | 0a1044c | 2017-08-09 09:50:51 -0500 | [diff] [blame] | 169 | |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 170 | 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 | |
| 176 | Check Activation Status |
| 177 | [Documentation] Check if software state is "Active". |
| 178 | [Arguments] ${status} |
George Keishing | 0a1044c | 2017-08-09 09:50:51 -0500 | [diff] [blame] | 179 | |
| 180 | # Description of argument(s): |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 181 | # status Activation status |
| 182 | # (e.g. "xyz.openbmc_project.Software.Activation.Activations.Active") |
| 183 | Should Be Equal As Strings ${ACTIVE} ${status} |