blob: 3c4ac8baacb150644627a34c524fd4cc9619cebd [file] [log] [blame]
Chris Austenb29d2e82016-06-07 12:25:35 -05001*** Settings ***
George Keishingc8166ed2017-02-24 03:53:38 -06002Documentation System inventory related test.
3
Chris Austenb29d2e82016-06-07 12:25:35 -05004Resource ../lib/rest_client.robot
5Resource ../lib/utils.robot
Rahul Maheshwari908df572017-02-16 04:41:54 -06006Resource ../lib/state_manager.robot
George Keishingd55a4be2016-08-26 03:28:17 -05007Resource ../lib/openbmc_ffdc.robot
Chris Austenb29d2e82016-06-07 12:25:35 -05008
9Variables ../data/variables.py
George Keishingc8166ed2017-02-24 03:53:38 -060010Variables ../data/inventory.py
Chris Austenb29d2e82016-06-07 12:25:35 -050011
George Keishingc8166ed2017-02-24 03:53:38 -060012Suite setup Test Suite Setup
Rahul Maheshwari908df572017-02-16 04:41:54 -060013Test Teardown FFDC On Test Case Fail
Chris Austenb29d2e82016-06-07 12:25:35 -050014
Rahul Maheshwari3e9b0de2017-03-20 06:25:44 -050015Force Tags Inventory
16
Chris Austenb29d2e82016-06-07 12:25:35 -050017*** Test Cases ***
18
George Keishingc8166ed2017-02-24 03:53:38 -060019Verify System Inventory Path
20 [Documentation] Check if system inventory path exist.
21 [Tags] Verify_System_Inventory_Path
22 # When the host is booted, system inventory path should exist.
23 # Example: /xyz/openbmc_project/inventory/system
24 Get Inventory system
Chris Austenb29d2e82016-06-07 12:25:35 -050025
Rahul Maheshwaribb20f732016-10-24 06:27:14 -050026
George Keishingc8166ed2017-02-24 03:53:38 -060027Verify Chassis Motherboard Properties
28 [Documentation] Check if chassis motherboard properties are
29 ... populated valid.
30 [Tags] Verify_Chassis_Motherboard_Properties
31 # When the host is booted, the following properties should
32 # be populated Manufacturer, PartNumber, SerialNumber and
33 # it should not be zero's.
34 # Example:
35 # "data": {
36 # "/xyz/openbmc_project/inventory/system/chassis/motherboard": {
37 # "BuildDate": "",
38 # "Manufacturer": "0000000000000000",
39 # "Model": "",
40 # "PartNumber": "0000000",
41 # "Present": 0,
42 # "PrettyName": "SYSTEM PLANAR ",
43 # "SerialNumber": "000000000000"
44 # }
45 ${properties}= Get Inventory system/chassis/motherboard
46 Should Not Be Equal As Strings
47 ... ${properties["data"]["Manufacturer"]} 0000000000000000
48 ... msg=motherboard field invalid.
49 Should Not Be Equal As Strings
50 ... ${properties["data"]["PartNumber"]} 0000000
51 ... msg=motherboard part number invalid.
52 Should Not Be Equal As Strings
53 ... ${properties["data"]["SerialNumber"]} 000000000000
54 ... msg=motherboard serial number invalid.
Chris Austenb29d2e82016-06-07 12:25:35 -050055
George Keishingae355302017-03-13 04:34:58 -050056Verify CPU Present
57 [Documentation] Check if the FRU "Present" is set for CPU's.
58 [Tags] Verify_CPU_Present
59 # System inventory cpu list:
60 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
61 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1
62 # Example:
63 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0": {
64 # "FieldReplaceable": 1,
65 # "BuildDate": "",
66 # "Cached": 0,
67 # "SerialNumber": "YA3933741574",
68 # "Version": "10",
69 # "Model": "",
70 # "PrettyName": "PROCESSOR MODULE",
71 # "PartNumber": "01HL322",
72 # "Present": 1,
73 # "Manufacturer": "IBM"
74 # },
75 # The CPU properties "Present" should be boolean 1.
76
77 ${cpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system cpu
78 :FOR ${cpu_uri} IN @{cpu_list}
79 \ ${present}= Read Attribute ${cpu_uri} Present
80 \ Should Be True ${present}
81
82
83Verify DIMM Present
84 [Documentation] Check if the FRU "Present" is set for DIMM's.
85 [Tags] Verify_DIMM_Present
86 # Example:
87 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": {
88 # "FieldReplaceable": 1,
89 # "BuildDate": "",
90 # "Cached": 0,
91 # "SerialNumber": "0x0300cf4f",
92 # "Version": "0x00",
93 # "Model": "M393A1G40EB1-CRC ",
94 # "PrettyName": "0x0c",
95 # "PartNumber": "",
96 # "Present": 1,
97 # "Manufacturer": "0xce80"
98 # },
99
100 # The DIMM properties "Present" should be boolean 1.
101
102 ${dimm_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system dimm
103 :FOR ${dimm_uri} IN @{dimm_list}
104 \ ${present}= Read Attribute ${dimm_uri} Present
105 \ Should Be True ${present}
106
107
Chris Austenb29d2e82016-06-07 12:25:35 -0500108*** Keywords ***
109
George Keishingc8166ed2017-02-24 03:53:38 -0600110Test Suite Setup
111 [Documentation] Do the initial suite setup.
112 ${current_state}= Get Host State
113 Run Keyword If '${current_state}' == 'Off'
114 ... Initiate Host Boot
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500115
George Keishingcaac9f32017-03-09 02:14:27 -0600116 Wait Until Keyword Succeeds
117 ... 10 min 10 sec Is OS Starting
118
Chris Austenb29d2e82016-06-07 12:25:35 -0500119
George Keishingc8166ed2017-02-24 03:53:38 -0600120Get Inventory
121 [Documentation] Get the properties of an endpoint.
122 [Arguments] ${endpoint}
123 # Description of arguments:
124 # endpoint string for which url path ending.
125 # Example: "system" is the endpoint for url
126 # /xyz/openbmc_project/inventory/system
127 ${resp}= OpenBMC Get Request ${HOST_INVENTORY_URI}${endpoint}
128 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
129 ${jsondata}= To JSON ${resp.content}
130 [Return] ${jsondata}