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 *** |
Sridevi Ramesh | 206173d | 2016-08-16 05:41:40 -0500 | [diff] [blame] | 15 | Test BMC Version |
| 16 | [Documentation] Verifying if the BMC Version field is set with valid strings.\n |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 17 | ... Expected in following format: |
| 18 | ... $ git describe --dirty |
| 19 | ... v0.1-34-g95f7347 |
| 20 | ... $ |
Sridevi Ramesh | 83f5c59 | 2017-01-20 04:35:13 -0600 | [diff] [blame] | 21 | [Tags] Test_BMC_Version |
| 22 | |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 23 | ${resp}= OpenBMC Get Request |
| 24 | ... ${INVENTORY_URI}system/chassis/motherboard/bmc |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 25 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 26 | ${jsondata}= To Json ${resp.content} |
Sridevi Ramesh | 206173d | 2016-08-16 05:41:40 -0500 | [diff] [blame] | 27 | Should not be empty ${jsondata["data"]["version"]} msg=version field is empty |
| 28 | Should Match Regexp ${jsondata["data"]["version"]} ^v\\d+\.\\d+ |
| 29 | |
| 30 | Test BIOS Version |
| 31 | [Documentation] Verifying if the BIOS Version field is set with valid strings.\n |
| 32 | ... Expected in following format: |
| 33 | ... open-power-barreleye-v1.8 |
| 34 | ... $ |
Rahul Maheshwari | bb20f73 | 2016-10-24 06:27:14 -0500 | [diff] [blame] | 35 | [Tags] chassisboot Test_BIOS_Version |
Sridevi Ramesh | 83f5c59 | 2017-01-20 04:35:13 -0600 | [diff] [blame] | 36 | |
George Keishing | ec80737 | 2016-12-05 03:54:51 -0600 | [diff] [blame] | 37 | ${resp}= OpenBMC Get Request ${INVENTORY_URI}system/bios |
Sridevi Ramesh | 206173d | 2016-08-16 05:41:40 -0500 | [diff] [blame] | 38 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 39 | ${jsondata}= To Json ${resp.content} |
| 40 | Should not be empty ${jsondata["data"]["Version"]} msg=Version field is empty |
| 41 | Should Match Regexp ${jsondata["data"]["Version"]} ^open+\-\power+\-\ |
George Keishing | ab5157b | 2017-02-09 12:24:25 -0600 | [diff] [blame] | 42 | |
| 43 | |
| 44 | Software Version Management |
| 45 | [Documentation] Verify version and activation status. |
| 46 | [Tags] Software_Version_Management |
| 47 | ${managed_list}= Get Software Version List |
| 48 | :FOR ${element} IN @{managed_list} |
| 49 | \ Verify Software Properties ${element} |
| 50 | |
| 51 | |
| 52 | *** Keywords *** |
| 53 | |
| 54 | Get Software Version List |
| 55 | [Documentation] Get the software version endpoints list. |
| 56 | # Example of JSON body data returned |
| 57 | # "data": [ |
| 58 | # "/xyz/openbmc_project/software/53c70e7b" |
| 59 | # ], |
| 60 | |
| 61 | ${resp}= OpenBMC Get Request ${SOFTWARE_VERSION_URI} |
| 62 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 63 | ${jsondata}= To JSON ${resp.content} |
| 64 | [Return] ${jsondata["data"]} |
| 65 | |
| 66 | |
| 67 | Verify Software Properties |
| 68 | [Documentation] Verify the software endpoints properties. |
| 69 | [Arguments] ${endpoint} |
| 70 | # Description of arguments: |
| 71 | # endpoint Managed element by software version manager. |
| 72 | # Endpoint URI would be as shown below |
| 73 | # https://xx.xx.xx.xx/xyz/openbmc_project/software/53c70e7b |
| 74 | ${resp}= OpenBMC Get Request ${endpoint} |
| 75 | Should Be Equal As Strings ${resp.status_code} ${HTTP_OK} |
| 76 | ${jsondata}= To JSON ${resp.content} |
| 77 | |
| 78 | Check Activation Status ${jsondata["data"]["Activation"]} |
| 79 | Check BMC Version ${jsondata["data"]["Version"]} |
| 80 | |
| 81 | |
| 82 | Check BMC Version |
| 83 | [Documentation] Get BMC version from /etc/os-release and compare. |
| 84 | [Arguments] ${version} |
| 85 | # Description of arguments: |
| 86 | # version Software version (e.g. "v1.99.2-107-g2be34d2-dirty") |
| 87 | Open Connection And Log In |
| 88 | ${cmd}= Set Variable grep ^VERSION_ID= /etc/os-release | cut -f 2 -d '=' |
| 89 | ${output}= Execute Command On BMC ${cmd} |
| 90 | Should Be Equal As Strings ${version} ${output[1:-1]} |
| 91 | |
| 92 | |
| 93 | Check Activation Status |
| 94 | [Documentation] Check if software state is "Active". |
| 95 | [Arguments] ${status} |
| 96 | # Description of arguments: |
| 97 | # status Activation status |
| 98 | # (e.g. "xyz.openbmc_project.Software.Activation.Activations.Active") |
| 99 | Should Be Equal As Strings ${ACTIVE} ${status} |