| Marissa Garza | d76b142 | 2019-09-13 16:31:54 -0500 | [diff] [blame] | 1 | *** Settings *** | 
 | 2 | Documentation       Get the system power supply voltage readings. | 
 | 3 |  | 
 | 4 | Resource            ../../lib/bmc_redfish_resource.robot | 
 | 5 | Resource            ../../lib/bmc_redfish_utils.robot | 
 | 6 | Resource            ../../lib/openbmc_ffdc.robot | 
 | 7 | Library             ../../lib/gen_robot_valid.py | 
 | 8 |  | 
 | 9 | Suite Setup         Suite Setup Execution | 
 | 10 | Suite Teardown      Suite Teardown Execution | 
 | 11 | Test Setup          Printn | 
 | 12 | Test Teardown       Test Teardown Execution | 
 | 13 |  | 
 | 14 |  | 
 | 15 | *** Test Cases *** | 
 | 16 |  | 
 | 17 | Verify Power Control Consumed Watts | 
 | 18 |     [Documentation]  Verify there are no invalid power control consumed watt records. | 
 | 19 |     [Tags]  Verify_Power_Control_Consumed_Watts | 
 | 20 |     [Template]  Verify Power Metric Records | 
 | 21 |  | 
 | 22 |     # record_type   redfish_uri                   reading_type | 
 | 23 |     PowerControl    ${REDFISH_CHASSIS_POWER_URI}  PowerConsumedWatts | 
 | 24 |  | 
 | 25 |  | 
 | 26 | *** Keywords *** | 
 | 27 |  | 
 | 28 | Verify Power Metric Records | 
 | 29 |     [Documentation]  Verify the power metric records. | 
 | 30 |     [Arguments]  ${record_type}  ${redfish_uri}  ${reading_type} | 
 | 31 |  | 
 | 32 |     # Description of Arguments(s): | 
 | 33 |     # record_type    The sensor record type (e.g. "PowerControl") | 
 | 34 |     # redfish_uri    The power supply URI (e.g. /redfish/v1/Chassis/chassis/Power) | 
 | 35 |     # reading_type   The power metric readings (e.g. "PowerConsumedWatts") | 
 | 36 |  | 
 | 37 |     Verify Valid Records  ${record_type}  ${redfish_uri}  ${reading_type} | 
 | 38 |  | 
 | 39 |     ${records}=  Redfish.Get Attribute  ${redfish_uri}  ${record_type} | 
 | 40 |  | 
 | 41 |     ${invalid_records}=  Evaluate | 
 | 42 |     ...  [x for x in ${records} if not x['${reading_type}'] <= x['PowerMetrics']['MaxConsumedWatts']] | 
 | 43 |  | 
 | 44 |     Valid Length  invalid_records  max_length=0 | 
 | 45 |  | 
 | 46 |  | 
 | 47 | Suite Teardown Execution | 
 | 48 |     [Documentation]  Do the post suite teardown. | 
 | 49 |  | 
 | 50 |     Redfish.Logout | 
 | 51 |  | 
 | 52 |  | 
 | 53 | Suite Setup Execution | 
 | 54 |     [Documentation]  Do test case setup tasks. | 
 | 55 |  | 
 | 56 |     Printn | 
 | 57 |     Redfish Power On  stack_mode=skip | 
 | 58 |     Redfish.Login | 
 | 59 |  | 
 | 60 |  | 
 | 61 | Test Teardown Execution | 
 | 62 |     [Documentation]  Do the post test teardown. | 
 | 63 |  | 
 | 64 |     FFDC On Test Case Fail |