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 |
Gunnar Mills | eac1af2 | 2016-11-14 15:30:09 -0600 | [diff] [blame] | 8 | Test Teardown FFDC On Test Case Fail |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 9 | |
| 10 | |
| 11 | *** Variables *** |
| 12 | |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 13 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 14 | *** Test Cases *** |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 15 | |
| 16 | Software Version Management |
| 17 | [Documentation] Verify version and activation status. |
| 18 | [Tags] Software_Version_Management |
| 19 | ${managed_list}= Get Software Version List |
| 20 | :FOR ${element} IN @{managed_list} |
| 21 | \ Verify Software Properties ${element} |
| 22 | |
| 23 | |
| 24 | *** Keywords *** |
| 25 | |
| 26 | Get Software Version List |
| 27 | [Documentation] Get the software version endpoints list. |
| 28 | # Example of JSON body data returned |
| 29 | # "data": [ |
| 30 | # "/xyz/openbmc_project/software/53c70e7b" |
| 31 | # ], |
| 32 | |
| 33 | ${resp}= OpenBMC Get Request ${SOFTWARE_VERSION_URI} |
| 34 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 35 | ${jsondata}= To JSON ${resp.content} |
| 36 | [Return] ${jsondata["data"]} |
| 37 | |
| 38 | |
| 39 | Verify Software Properties |
| 40 | [Documentation] Verify the software endpoints properties. |
| 41 | [Arguments] ${endpoint} |
| 42 | # Description of arguments: |
| 43 | # endpoint Managed element by software version manager. |
| 44 | # Endpoint URI would be as shown below |
| 45 | # https://xx.xx.xx.xx/xyz/openbmc_project/software/53c70e7b |
| 46 | ${resp}= OpenBMC Get Request ${endpoint} |
| 47 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 48 | ${jsondata}= To JSON ${resp.content} |
| 49 | |
| 50 | Check Activation Status ${jsondata["data"]["Activation"]} |
| 51 | Check BMC Version ${jsondata["data"]["Version"]} |
| 52 | |
| 53 | |
| 54 | Check BMC Version |
| 55 | [Documentation] Get BMC version from /etc/os-release and compare. |
| 56 | [Arguments] ${version} |
| 57 | # Description of arguments: |
| 58 | # version Software version (e.g. "v1.99.2-107-g2be34d2-dirty") |
| 59 | Open Connection And Log In |
| 60 | ${cmd}= Set Variable grep ^VERSION_ID= /etc/os-release | cut -f 2 -d '=' |
| 61 | ${output}= Execute Command On BMC ${cmd} |
| 62 | Should Be Equal As Strings ${version} ${output[1:-1]} |
| 63 | |
| 64 | |
| 65 | Check Activation Status |
| 66 | [Documentation] Check if software state is "Active". |
| 67 | [Arguments] ${status} |
| 68 | # Description of arguments: |
| 69 | # status Activation status |
| 70 | # (e.g. "xyz.openbmc_project.Software.Activation.Activations.Active") |
| 71 | Should Be Equal As Strings ${ACTIVE} ${status} |