Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 1 | *** Settings *** |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 2 | Documentation System inventory related test. |
| 3 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 4 | Resource ../lib/rest_client.robot |
| 5 | Resource ../lib/utils.robot |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 6 | Resource ../lib/state_manager.robot |
George Keishing | d55a4be | 2016-08-26 03:28:17 -0500 | [diff] [blame] | 7 | Resource ../lib/openbmc_ffdc.robot |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 8 | |
| 9 | Variables ../data/variables.py |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 10 | Variables ../data/inventory.py |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 11 | |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 12 | Suite setup Test Suite Setup |
Rahul Maheshwari | 908df57 | 2017-02-16 04:41:54 -0600 | [diff] [blame] | 13 | Test Teardown FFDC On Test Case Fail |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 14 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 15 | *** Test Cases *** |
| 16 | |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 17 | Verify 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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 23 | |
Rahul Maheshwari | bb20f73 | 2016-10-24 06:27:14 -0500 | [diff] [blame] | 24 | |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 25 | Verify 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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 53 | |
| 54 | *** Keywords *** |
| 55 | |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 56 | Test 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 Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 61 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 62 | |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 63 | Get 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} |