Marissa Garza | 6e3f9ec | 2019-07-24 15:31:26 -0500 | [diff] [blame] | 1 | *** Settings *** |
Marissa Garza | d76b142 | 2019-09-13 16:31:54 -0500 | [diff] [blame] | 2 | Documentation Get the system power supply voltage readings. |
Marissa Garza | 6e3f9ec | 2019-07-24 15:31:26 -0500 | [diff] [blame] | 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 Supplies Input Watts |
| 18 | [Documentation] Verify there are no invalid power supply input watt records. |
| 19 | [Tags] Verify_Power_Supplies_Input_Watts |
| 20 | [Template] Verify Watts Record |
| 21 | |
| 22 | # record_type redfish_uri reading_type |
Marissa Garza | 6f7958a | 2019-08-13 14:58:05 -0500 | [diff] [blame] | 23 | PowerSupplies ${REDFISH_CHASSIS_POWER_URI} PowerInputWatts |
Marissa Garza | 6e3f9ec | 2019-07-24 15:31:26 -0500 | [diff] [blame] | 24 | |
| 25 | |
| 26 | Verify Power Supplies Input Output Voltages |
| 27 | [Documentation] Verify there are no invalid power supply voltage records. |
| 28 | [Tags] Verify_Power_Supplies_Input_Output_Voltages |
| 29 | [Template] Verify Voltage Records |
| 30 | |
| 31 | # record_type redfish_uri reading_type |
Marissa Garza | 6f7958a | 2019-08-13 14:58:05 -0500 | [diff] [blame] | 32 | Voltages ${REDFISH_CHASSIS_POWER_URI} ReadingVolts |
Marissa Garza | 6e3f9ec | 2019-07-24 15:31:26 -0500 | [diff] [blame] | 33 | |
| 34 | |
Marissa Garza | fdee1b0 | 2019-09-20 14:52:12 -0500 | [diff] [blame] | 35 | Verify Power Supplies Efficiency Percentage |
| 36 | [Documentation] Verify the efficiency percentage is set to correct value. |
| 37 | [Tags] Verify_Power_Supplies_Efficiency_Percentage |
| 38 | |
| 39 | # Example output: |
| 40 | # records: |
| 41 | # [0]: |
| 42 | # [@odata.id]: /redfish/v1/Chassis/chassis/Power#/PowerSupplies/0 |
| 43 | # [EfficiencyPercent]: 90 |
| 44 | # [IndicatorLED]: Off |
| 45 | # [Manufacturer]: |
| 46 | # [MemberId]: powersupply0 |
| 47 | # [Model]: 2B1D |
| 48 | # [Name]: powersupply0 |
| 49 | # [PartNumber]: 01KL779 |
| 50 | # [PowerInputWatts]: 106.0 |
| 51 | # [SerialNumber]: 75B1C2 |
| 52 | # [Status]: |
| 53 | # [Health]: OK |
| 54 | # [State]: Enabled |
| 55 | |
| 56 | ${records}= Verify Valid Records PowerSupplies ${REDFISH_CHASSIS_POWER_URI} EfficiencyPercent |
| 57 | ${efficiency_percentages}= Nested Get EfficiencyPercent ${records} |
| 58 | Valid List efficiency_percentages [90] |
| 59 | |
| 60 | |
Marissa Garza | 6e3f9ec | 2019-07-24 15:31:26 -0500 | [diff] [blame] | 61 | *** Keywords *** |
| 62 | |
| 63 | Verify Watts Record |
| 64 | [Documentation] Verify the power watt records. |
| 65 | [Arguments] ${record_type} ${redfish_uri} ${reading_type} |
| 66 | |
| 67 | # Description of Arguments(s): |
| 68 | # record_type The sensor record type (e.g. "PowerSupplies") |
Marissa Garza | 6f7958a | 2019-08-13 14:58:05 -0500 | [diff] [blame] | 69 | # redfish_uri The power supply URI (e.g. /redfish/v1/Chassis/chassis/Power) |
Marissa Garza | 6e3f9ec | 2019-07-24 15:31:26 -0500 | [diff] [blame] | 70 | # reading_type The power watt readings (e.g. "PowerInputWatts") |
| 71 | |
| 72 | Verify Valid Records ${record_type} ${redfish_uri} ${reading_type} |
| 73 | |
| 74 | |
| 75 | Verify Voltage Records |
| 76 | [Documentation] Verify the power voltage records. |
| 77 | [Arguments] ${record_type} ${redfish_uri} ${reading_type} |
| 78 | |
| 79 | # Description of Arguments(s): |
| 80 | # record_type The sensor record type (e.g. "Voltages") |
Marissa Garza | 6f7958a | 2019-08-13 14:58:05 -0500 | [diff] [blame] | 81 | # redfish_uri The power supply URI (e.g. /redfish/v1/Chassis/chassis/Power) |
Marissa Garza | 6e3f9ec | 2019-07-24 15:31:26 -0500 | [diff] [blame] | 82 | # reading_type The power voltage readings (e.g. "ReadingVolts") |
| 83 | |
| 84 | Verify Valid Records ${record_type} ${redfish_uri} ${reading_type} |
| 85 | |
Marissa Garza | d76b142 | 2019-09-13 16:31:54 -0500 | [diff] [blame] | 86 | ${records}= Redfish.Get Attribute ${redfish_uri} ${record_type} |
Marissa Garza | 6e3f9ec | 2019-07-24 15:31:26 -0500 | [diff] [blame] | 87 | |
Marissa Garza | 743d597 | 2020-01-24 14:17:52 -0600 | [diff] [blame] | 88 | ${cmd} Catenate [x for x in ${records} |
| 89 | ... if not x['LowerThresholdNonCritical'] <= x['${reading_type}'] <= x['UpperThresholdNonCritical']] |
| 90 | ${invalid_records}= Evaluate ${cmd} |
Marissa Garza | 6e3f9ec | 2019-07-24 15:31:26 -0500 | [diff] [blame] | 91 | |
Marissa Garza | d76b142 | 2019-09-13 16:31:54 -0500 | [diff] [blame] | 92 | Valid Length invalid_records max_length=0 |
Marissa Garza | 6e3f9ec | 2019-07-24 15:31:26 -0500 | [diff] [blame] | 93 | |
Marissa Garza | fdee1b0 | 2019-09-20 14:52:12 -0500 | [diff] [blame] | 94 | |
Marissa Garza | 6e3f9ec | 2019-07-24 15:31:26 -0500 | [diff] [blame] | 95 | Suite Teardown Execution |
| 96 | [Documentation] Do the post suite teardown. |
| 97 | |
| 98 | Redfish.Logout |
| 99 | |
| 100 | |
| 101 | Suite Setup Execution |
| 102 | [Documentation] Do test case setup tasks. |
| 103 | |
| 104 | Printn |
Marissa Garza | 6f7958a | 2019-08-13 14:58:05 -0500 | [diff] [blame] | 105 | Redfish Power On stack_mode=skip |
Marissa Garza | 6e3f9ec | 2019-07-24 15:31:26 -0500 | [diff] [blame] | 106 | Redfish.Login |
| 107 | |
| 108 | |
| 109 | Test Teardown Execution |
| 110 | [Documentation] Do the post test teardown. |
| 111 | |
| 112 | FFDC On Test Case Fail |