blob: b70bc5432ee87505030dd62e46ed988775cfd7e7 [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
George Keishingcaac9f32017-03-09 02:14:27 -060062 Wait Until Keyword Succeeds
63 ... 10 min 10 sec Is OS Starting
64
Chris Austenb29d2e82016-06-07 12:25:35 -050065
George Keishingc8166ed2017-02-24 03:53:38 -060066Get Inventory
67 [Documentation] Get the properties of an endpoint.
68 [Arguments] ${endpoint}
69 # Description of arguments:
70 # endpoint string for which url path ending.
71 # Example: "system" is the endpoint for url
72 # /xyz/openbmc_project/inventory/system
73 ${resp}= OpenBMC Get Request ${HOST_INVENTORY_URI}${endpoint}
74 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
75 ${jsondata}= To JSON ${resp.content}
76 [Return] ${jsondata}