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 | |
George Keishing | ae35530 | 2017-03-13 04:34:58 -0500 | [diff] [blame] | 54 | Verify 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 | |
| 81 | Verify 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 Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 106 | *** Keywords *** |
| 107 | |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 108 | Test 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 Maheshwari | 4a4eb6e | 2016-09-24 01:06:36 -0500 | [diff] [blame] | 113 | |
George Keishing | caac9f3 | 2017-03-09 02:14:27 -0600 | [diff] [blame] | 114 | Wait Until Keyword Succeeds |
| 115 | ... 10 min 10 sec Is OS Starting |
| 116 | |
Chris Austen | b29d2e8 | 2016-06-07 12:25:35 -0500 | [diff] [blame] | 117 | |
George Keishing | c8166ed | 2017-02-24 03:53:38 -0600 | [diff] [blame] | 118 | Get 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} |