blob: bbfcccc6c6873609e94bdc81b493e59d62d42edf [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
George Keishing0a1044c2017-08-09 09:50:51 -05008Resource ../lib/code_update_utils.robot
Gunnar Millseac1af22016-11-14 15:30:09 -06009Test Teardown FFDC On Test Case Fail
Chris Austenb29d2e82016-06-07 12:25:35 -050010
11
Chris Austenb29d2e82016-06-07 12:25:35 -050012*** Test Cases ***
George Keishingab5157b2017-02-09 12:24:25 -060013
George Keishing0a1044c2017-08-09 09:50:51 -050014BMC Software Version
15 [Documentation] Verify BMC version and activation status.
16 [Tags] BMC_Software_Version
17 [Template] Verify Software Version
18
19 # Software Version Purpose
20 ${VERSION_PURPOSE_BMC}
21
22Host Software Version
23 [Documentation] Verify host version and activation status.
24 [Tags] Host_Software_Version
25 [Template] Verify Software Version
26
27 # Software Version Purpose
28 ${VERSION_PURPOSE_HOST}
George Keishingab5157b2017-02-09 12:24:25 -060029
30
31*** Keywords ***
32
George Keishing0a1044c2017-08-09 09:50:51 -050033Verify Software Version
34 [Documentation] Verify version and activation status.
35 [Arguments] ${software_purpose}
George Keishingab5157b2017-02-09 12:24:25 -060036
George Keishing0a1044c2017-08-09 09:50:51 -050037 # Description of argument(s):
38 # software_purpose BMC or host software purpose.
39
40 # Example:
41 # /xyz/openbmc_project/software/list
42 # [
43 # "/xyz/openbmc_project/software/2f974579",
44 # "/xyz/openbmc_project/software/136cf504"
45 # ]
46 ${obj_list}= Get Software Objects ${software_purpose}
47 : FOR ${index} IN @{obj_list}
48 \ ${resp}= Get Host Software Property ${index}
49 \ Verify Software Properties ${resp} ${software_purpose}
George Keishingab5157b2017-02-09 12:24:25 -060050
51
52Verify Software Properties
George Keishing0a1044c2017-08-09 09:50:51 -050053 [Documentation] Verify the software object properties.
54 [Arguments] ${software_property} ${software_purpose}
George Keishingab5157b2017-02-09 12:24:25 -060055
George Keishing0a1044c2017-08-09 09:50:51 -050056 # Description of argument(s):
57 # software_property JSON response data.
58 # software_purpose BMC or host software purpose
59 # (e.g. "xyz.openbmc_project.Software.Version.VersionPurpose.BMC"
60 # "xyz.openbmc_project.Software.Version.VersionPurpose.Host").
61
62 Check Activation Status ${software_property["Activation"]}
63 Run Keyword If '${software_purpose}' == '${VERSION_PURPOSE_BMC}'
64 ... Check BMC Version ${software_property["Version"]}
George Keishingab5157b2017-02-09 12:24:25 -060065
66
67Check BMC Version
68 [Documentation] Get BMC version from /etc/os-release and compare.
69 [Arguments] ${version}
George Keishing0a1044c2017-08-09 09:50:51 -050070
71 # Description of argument(s):
George Keishingab5157b2017-02-09 12:24:25 -060072 # version Software version (e.g. "v1.99.2-107-g2be34d2-dirty")
George Keishing0a1044c2017-08-09 09:50:51 -050073
George Keishingab5157b2017-02-09 12:24:25 -060074 Open Connection And Log In
75 ${cmd}= Set Variable grep ^VERSION_ID= /etc/os-release | cut -f 2 -d '='
76 ${output}= Execute Command On BMC ${cmd}
77 Should Be Equal As Strings ${version} ${output[1:-1]}
78
79
80Check Activation Status
81 [Documentation] Check if software state is "Active".
82 [Arguments] ${status}
George Keishing0a1044c2017-08-09 09:50:51 -050083
84 # Description of argument(s):
George Keishingab5157b2017-02-09 12:24:25 -060085 # status Activation status
86 # (e.g. "xyz.openbmc_project.Software.Activation.Activations.Active")
87 Should Be Equal As Strings ${ACTIVE} ${status}