blob: 86ee53d4025627c043f86b85467ac015f65cd4d0 [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
Gunnar Millseac1af22016-11-14 15:30:09 -06008Test Teardown FFDC On Test Case Fail
Chris Austenb29d2e82016-06-07 12:25:35 -05009
10
11*** Variables ***
12
George Keishingab5157b2017-02-09 12:24:25 -060013
Chris Austenb29d2e82016-06-07 12:25:35 -050014*** Test Cases ***
Sridevi Ramesh206173d2016-08-16 05:41:40 -050015Test BMC Version
16 [Documentation] Verifying if the BMC Version field is set with valid strings.\n
Chris Austenb29d2e82016-06-07 12:25:35 -050017 ... Expected in following format:
18 ... $ git describe --dirty
19 ... v0.1-34-g95f7347
20 ... $
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060021 [Tags] Test_BMC_Version
22
George Keishingec807372016-12-05 03:54:51 -060023 ${resp}= OpenBMC Get Request
24 ... ${INVENTORY_URI}system/chassis/motherboard/bmc
Chris Austenb29d2e82016-06-07 12:25:35 -050025 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
26 ${jsondata}= To Json ${resp.content}
Sridevi Ramesh206173d2016-08-16 05:41:40 -050027 Should not be empty ${jsondata["data"]["version"]} msg=version field is empty
28 Should Match Regexp ${jsondata["data"]["version"]} ^v\\d+\.\\d+
29
30Test 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 Maheshwaribb20f732016-10-24 06:27:14 -050035 [Tags] chassisboot Test_BIOS_Version
Sridevi Ramesh83f5c592017-01-20 04:35:13 -060036
George Keishingec807372016-12-05 03:54:51 -060037 ${resp}= OpenBMC Get Request ${INVENTORY_URI}system/bios
Sridevi Ramesh206173d2016-08-16 05:41:40 -050038 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 Keishingab5157b2017-02-09 12:24:25 -060042
43
44Software 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
54Get 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
67Verify 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
82Check 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
93Check 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}