George Keishing | dc4a423 | 2018-02-19 12:13:36 -0600 | [diff] [blame] | 1 | *** Settings *** |
| 2 | Documentation Test power supply telemetry. |
| 3 | |
| 4 | Resource ../lib/openbmc_ffdc.robot |
| 5 | Resource ../lib/open_power_utils.robot |
| 6 | Resource ../lib/boot_utils.robot |
| 7 | |
| 8 | Test Teardown FFDC On Test Case Fail |
| 9 | |
| 10 | *** Variables *** |
| 11 | |
| 12 | # ----------------------------------- |
| 13 | # Output Current and Wattage Limits |
| 14 | # ----------------------------------- |
| 15 | # * 200 VAC (200 - 208 VAC) ... 2104W |
| 16 | # * 230 VAC (207 - 253 VAC) ... 2226W |
| 17 | # * 277 VAC (249 - 305 VAC) ... 2226W |
| 18 | # ----------------------------------- |
| 19 | |
| 20 | # With a loaded HTX work-load the wattage is typically within half of the upper |
| 21 | # limit. If the power drawn goes beyond the upper power limit, this test will |
| 22 | # fail. |
| 23 | ${upper_power_limit} ${2104} |
| 24 | ${lower_power_limit} ${0} |
| 25 | ${power_data_collection_interval} ${30} |
| 26 | |
| 27 | # Every n seconds, the system collects the following for each power supply |
| 28 | # (e.g. ps0, ps1, etc): |
| 29 | # - The average power being drawn over the interval. |
| 30 | # - The maximum power drawn over the interval. |
| 31 | # At any given time, such readings can be obtained from the system. |
| 32 | # The lists shown below are examples of such data |
| 33 | # --------------------------------------------------------------------- |
| 34 | # /org/open_power/sensors/aggregation/per_30s/ps0_input_power/average |
| 35 | # [20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 225, 290, 255, 207, 124, 20] |
| 36 | # (max, min) (290, 20) |
| 37 | |
| 38 | # /org/open_power/sensors/aggregation/per_30s/ps1_input_power/average |
| 39 | # [19, 19, 20, 20, 19, 20, 20, 20, 20, 20, 69, 321, 286, 265, 228, 104] |
| 40 | # (max, min) (321, 19) |
| 41 | |
| 42 | # /org/open_power/sensors/aggregation/per_30s/ps0_input_power/maximum |
| 43 | # [20, 20, 20, 22, 22, 22, 22, 20, 22, 22, 338, 346, 308, 258, 172, 20] |
| 44 | # (max, min) (346, 20) |
| 45 | |
| 46 | # /org/open_power/sensors/aggregation/per_30s/ps1_input_power/maximum |
| 47 | # [24, 26, 26, 26, 26, 26, 26, 26, 26, 26, 322, 364, 338, 308, 258, 240] |
| 48 | # (max, min) (364, 24) |
| 49 | # --------------------------------------------------------------------- |
| 50 | |
| 51 | # To collect 3 iteration of sampling data. |
| 52 | ${LOOP_COUNT} ${3} |
| 53 | |
| 54 | |
| 55 | *** Test Cases *** |
| 56 | |
| 57 | Power Supply Test When Host Off |
| 58 | [Documentation] Check that power consumption is within limits when host |
| 59 | ... is off. |
| 60 | [Tags] Power_Supply_Test_When_Host_Off |
| 61 | |
| 62 | REST Power Off stack_mode=skip |
| 63 | ${power_sensor_path}= Get Sensors Aggregation URL List |
| 64 | ... /org/open_power/sensors/ |
| 65 | |
| 66 | Check Power Telemetry When Host Off ${power_sensor_path} |
| 67 | |
| 68 | |
| 69 | Power Supply Test When Host On |
| 70 | [Documentation] Check that power consumption is within limits when host |
| 71 | ... is on. |
| 72 | [Tags] Power_Supply_Test_When_Host_On |
| 73 | |
| 74 | REST Power On |
| 75 | ${power_sensor_path}= Get Sensors Aggregation URL List |
| 76 | ... /org/open_power/sensors/ |
| 77 | |
| 78 | Repeat Keyword ${LOOP_COUNT} times |
| 79 | ... Check Power Telemetry When Host On ${power_sensor_path} |
| 80 | |
| 81 | |
| 82 | *** Keywords *** |
| 83 | |
| 84 | Check Power Telemetry When Host On |
| 85 | [Documentation] Check that power consumption is within limits when host |
| 86 | ... is on. |
| 87 | [Arguments] ${power_paths} |
| 88 | |
| 89 | # Description of argument(s): |
| 90 | # power_paths A list of power paths (example list element |
| 91 | # "/org/open_power/sensors/aggregation/per_30s/ps0_input_power/average"). |
| 92 | |
| 93 | # Check for "average" aggregation. |
| 94 | :FOR ${power_path} IN @{power_paths[0]} |
| 95 | \ ${averages}= Get Sensors Aggregation Data ${power_path} |
| 96 | \ ${max} ${min}= Evaluate (max(@{averages}), min(@{averages})) |
| 97 | \ Should Be True ${max} < ${upper_power_limit} |
| 98 | ... msg=Wattage ${max} crossed ${upper_power_limit}. |
| 99 | \ Should Be True ${min} >= ${lower_power_limit} |
| 100 | ... msg=Wattage ${min} below ${lower_power_limit}. |
| 101 | |
| 102 | # Check for "maximum" aggregation. |
| 103 | :FOR ${power_path} IN @{power_paths[1]} |
| 104 | \ ${maximums}= Get Sensors Aggregation Data ${power_path} |
| 105 | \ ${max} ${min}= Evaluate (max(@{maximums}), min(@{maximums})) |
| 106 | \ Should Be True ${max} < ${upper_power_limit} |
| 107 | ... msg=Wattage ${max} crossed ${upper_power_limit}. |
| 108 | \ Should Be True ${min} >= ${lower_power_limit} |
| 109 | ... msg=Wattage ${min} below ${lower_power_limit}. |
| 110 | |
| 111 | # Every 30 seconds the power wattage data is updated. |
| 112 | Sleep ${power_data_collection_interval}s |
| 113 | |
| 114 | |
| 115 | Check Power Telemetry When Host Off |
| 116 | [Documentation] Check that power consumption is within limits when host |
| 117 | ... is off. |
| 118 | [Arguments] ${power_paths} |
| 119 | |
| 120 | # Description of argument(s): |
| 121 | # power_paths A list of power paths (example list element |
| 122 | # "/org/open_power/sensors/aggregation/per_30s/ps0_input_power/average"). |
| 123 | |
| 124 | # Every 30 seconds the power wattage data is updated. |
| 125 | Sleep ${power_data_collection_interval}s |
| 126 | |
| 127 | # Check for "average" aggregation. |
| 128 | :FOR ${power_path} IN @{power_paths[0]} |
| 129 | \ ${averages}= Get Sensors Aggregation Data ${power_path} |
| 130 | \ Should Be True ${averages[0]} == ${lower_power_limit} |
| 131 | ... msg=Wattage ${averages[0]} more than ${lower_power_limit}. |
| 132 | |
| 133 | # Check for "maximum" aggregation. |
| 134 | :FOR ${power_path} IN @{power_paths[1]} |
| 135 | \ ${maximums}= Get Sensors Aggregation Data ${power_path} |
| 136 | \ Should Be True ${maximums[0]} == ${lower_power_limit} |
| 137 | ... msg=Wattage ${maximums[0]} more than ${lower_power_limit}. |
| 138 | |