George Keishing | 27bf693 | 2017-08-07 14:30:40 -0500 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation BMC and PNOR update utilities keywords. |
| 3 | |
| 4 | Resource ../lib/rest_client.robot |
| 5 | |
| 6 | *** Keywords *** |
| 7 | |
| 8 | Get Software Objects |
| 9 | [Documentation] Get the host software objects and return as a list. |
| 10 | [Arguments] ${version_type}=${VERSION_PURPOSE_HOST} |
| 11 | |
| 12 | # Description of argument(s): |
| 13 | # version_type Either BMC or host version purpose. |
| 14 | # By default host version purpose string. |
| 15 | # (e.g. "xyz.openbmc_project.Software.Version.VersionPurpose.BMC" |
| 16 | # "xyz.openbmc_project.Software.Version.VersionPurpose.Host"). |
| 17 | |
| 18 | # Example: |
| 19 | # "data": [ |
| 20 | # "/xyz/openbmc_project/software/f3b29aa8", |
| 21 | # "/xyz/openbmc_project/software/e49bc78e", |
| 22 | # ], |
| 23 | # Iterate the list and return the host object name path list. |
| 24 | |
| 25 | ${host_list}= Create List |
| 26 | ${sw_list}= Read Properties ${SOFTWARE_VERSION_URI} |
| 27 | |
| 28 | :FOR ${index} IN @{sw_list} |
| 29 | \ ${attr_purpose}= Read Attribute ${index} Purpose quiet=${1} |
| 30 | \ Continue For Loop If '${attr_purpose}' != '${version_type}' |
| 31 | \ Append To List ${host_list} ${index} |
| 32 | |
| 33 | [return] ${host_list} |
| 34 | |
| 35 | |
| 36 | Get Host Software Property |
| 37 | [Documentation] Return a dictionary of host software properties. |
| 38 | [Arguments] ${host_object} |
| 39 | |
| 40 | # Description of argument(s): |
| 41 | # host_object Host software object path. |
| 42 | # (e.g. "/xyz/openbmc_project/software/f3b29aa8"). |
| 43 | |
| 44 | ${sw_attributes}= Read Properties ${host_object} |
| 45 | [return] ${sw_attributes} |
| 46 | |
| 47 | |
| 48 | Set Host Software Property |
| 49 | [Documentation] Set the host software properties of a given object. |
| 50 | [Arguments] ${host_object} ${sw_attribute} ${data} |
| 51 | |
| 52 | # Description of argument(s): |
| 53 | # host_object Host software object name. |
| 54 | # sw_attribute Host software attribute name. |
| 55 | # (e.g. "Activation", "Priority", "RequestedActivation" etc). |
| 56 | # data Value to be written. |
| 57 | |
| 58 | ${args}= Create Dictionary data=${data} |
| 59 | Write Attribute ${host_object} ${sw_attribute} data=${args} |
| 60 | |