blob: e4102f064489038e2e22b1a4e768cdda1187af9f [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
Chris Austenb29d2e82016-06-07 12:25:35 -050015*** Test Cases ***
16
George Keishingc8166ed2017-02-24 03:53:38 -060017Verify System Inventory Path
18 [Documentation] Check if system inventory path exist.
19 [Tags] Verify_System_Inventory_Path
20 # When the host is booted, system inventory path should exist.
21 # Example: /xyz/openbmc_project/inventory/system
22 Get Inventory system
Chris Austenb29d2e82016-06-07 12:25:35 -050023
Rahul Maheshwaribb20f732016-10-24 06:27:14 -050024
George Keishingc8166ed2017-02-24 03:53:38 -060025Verify Chassis Motherboard Properties
26 [Documentation] Check if chassis motherboard properties are
27 ... populated valid.
28 [Tags] Verify_Chassis_Motherboard_Properties
29 # When the host is booted, the following properties should
30 # be populated Manufacturer, PartNumber, SerialNumber and
31 # it should not be zero's.
32 # Example:
33 # "data": {
34 # "/xyz/openbmc_project/inventory/system/chassis/motherboard": {
35 # "BuildDate": "",
36 # "Manufacturer": "0000000000000000",
37 # "Model": "",
38 # "PartNumber": "0000000",
39 # "Present": 0,
40 # "PrettyName": "SYSTEM PLANAR ",
41 # "SerialNumber": "000000000000"
42 # }
43 ${properties}= Get Inventory system/chassis/motherboard
44 Should Not Be Equal As Strings
45 ... ${properties["data"]["Manufacturer"]} 0000000000000000
46 ... msg=motherboard field invalid.
47 Should Not Be Equal As Strings
48 ... ${properties["data"]["PartNumber"]} 0000000
49 ... msg=motherboard part number invalid.
50 Should Not Be Equal As Strings
51 ... ${properties["data"]["SerialNumber"]} 000000000000
52 ... msg=motherboard serial number invalid.
Chris Austenb29d2e82016-06-07 12:25:35 -050053
54*** Keywords ***
55
George Keishingc8166ed2017-02-24 03:53:38 -060056Test Suite Setup
57 [Documentation] Do the initial suite setup.
58 ${current_state}= Get Host State
59 Run Keyword If '${current_state}' == 'Off'
60 ... Initiate Host Boot
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -050061
Chris Austenb29d2e82016-06-07 12:25:35 -050062
George Keishingc8166ed2017-02-24 03:53:38 -060063Get Inventory
64 [Documentation] Get the properties of an endpoint.
65 [Arguments] ${endpoint}
66 # Description of arguments:
67 # endpoint string for which url path ending.
68 # Example: "system" is the endpoint for url
69 # /xyz/openbmc_project/inventory/system
70 ${resp}= OpenBMC Get Request ${HOST_INVENTORY_URI}${endpoint}
71 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
72 ${jsondata}= To JSON ${resp.content}
73 [Return] ${jsondata}