blob: d58c363cfb6d35e6f07b5b55436de2e2b7fd97a6 [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 ***
George Keishingab5157b2017-02-09 12:24:25 -060015
16Software 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
26Get 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
39Verify 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
54Check 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
65Check 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}