blob: ccd71b7ac3954cdde1bacbfb8d0bf1b17f946dab [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
George Keishingae355302017-03-13 04:34:58 -050054Verify CPU Present
55 [Documentation] Check if the FRU "Present" is set for CPU's.
56 [Tags] Verify_CPU_Present
57 # System inventory cpu list:
58 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0
59 # /xyz/openbmc_project/inventory/system/chassis/motherboard/cpu1
60 # Example:
61 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu0": {
62 # "FieldReplaceable": 1,
63 # "BuildDate": "",
64 # "Cached": 0,
65 # "SerialNumber": "YA3933741574",
66 # "Version": "10",
67 # "Model": "",
68 # "PrettyName": "PROCESSOR MODULE",
69 # "PartNumber": "01HL322",
70 # "Present": 1,
71 # "Manufacturer": "IBM"
72 # },
73 # The CPU properties "Present" should be boolean 1.
74
75 ${cpu_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system cpu
76 :FOR ${cpu_uri} IN @{cpu_list}
77 \ ${present}= Read Attribute ${cpu_uri} Present
78 \ Should Be True ${present}
79
80
81Verify DIMM Present
82 [Documentation] Check if the FRU "Present" is set for DIMM's.
83 [Tags] Verify_DIMM_Present
84 # Example:
85 # "/xyz/openbmc_project/inventory/system/chassis/motherboard/dimm0": {
86 # "FieldReplaceable": 1,
87 # "BuildDate": "",
88 # "Cached": 0,
89 # "SerialNumber": "0x0300cf4f",
90 # "Version": "0x00",
91 # "Model": "M393A1G40EB1-CRC ",
92 # "PrettyName": "0x0c",
93 # "PartNumber": "",
94 # "Present": 1,
95 # "Manufacturer": "0xce80"
96 # },
97
98 # The DIMM properties "Present" should be boolean 1.
99
100 ${dimm_list}= Get Endpoint Paths ${HOST_INVENTORY_URI}system dimm
101 :FOR ${dimm_uri} IN @{dimm_list}
102 \ ${present}= Read Attribute ${dimm_uri} Present
103 \ Should Be True ${present}
104
105
Chris Austenb29d2e82016-06-07 12:25:35 -0500106*** Keywords ***
107
George Keishingc8166ed2017-02-24 03:53:38 -0600108Test Suite Setup
109 [Documentation] Do the initial suite setup.
110 ${current_state}= Get Host State
111 Run Keyword If '${current_state}' == 'Off'
112 ... Initiate Host Boot
Rahul Maheshwari4a4eb6e2016-09-24 01:06:36 -0500113
George Keishingcaac9f32017-03-09 02:14:27 -0600114 Wait Until Keyword Succeeds
115 ... 10 min 10 sec Is OS Starting
116
Chris Austenb29d2e82016-06-07 12:25:35 -0500117
George Keishingc8166ed2017-02-24 03:53:38 -0600118Get Inventory
119 [Documentation] Get the properties of an endpoint.
120 [Arguments] ${endpoint}
121 # Description of arguments:
122 # endpoint string for which url path ending.
123 # Example: "system" is the endpoint for url
124 # /xyz/openbmc_project/inventory/system
125 ${resp}= OpenBMC Get Request ${HOST_INVENTORY_URI}${endpoint}
126 Should Be Equal As Strings ${resp.status_code} ${HTTP_OK}
127 ${jsondata}= To JSON ${resp.content}
128 [Return] ${jsondata}