Skip to content

Commit 125b23b

Browse files
kartbendkalowsk
authored andcommitted
twister: harness: power: fix amp to milliamp conversion
Fix amp to milliamp conversion where a 10^4 factor was applied instead of 10^3. Adjust existing test cases accordingly (including a small change to one of the expected RMS values in pm.power_states that either changed since the test was introduced or was set too aggressively back then). Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
1 parent 4f747ce commit 125b23b

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

scripts/pylib/power-twister-harness/test_power.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_power_harness(probe_class: PowerMonitor, test_data, request, dut: Devic
4646
)
4747

4848
# # Convert measured values from amps to milliamps for comparison
49-
rms_values_in_milliamps = [value * 1e4 for value in rms_values_measured]
49+
rms_values_in_milliamps = [value * 1e3 for value in rms_values_measured]
5050

5151
# # Log the calculated values in milliamps for debugging purposes
5252
logger.debug(f"Measured RMS values in mA: {rms_values_in_milliamps}")

tests/subsys/pm/power_residency_time/testcase.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ common:
1313
peak_padding: 40
1414
measurement_duration: 8
1515
num_of_transitions: 6
16-
expected_rms_values: [56.0, 4.0, 4.0, 1.2, 1.2, 0.26, 91]
16+
expected_rms_values: [5.6, 0.4, 0.4, 0.12, 0.12, 0.026, 9.1]
1717
tolerance_percentage: 20
1818
record:
1919
regex:

tests/subsys/pm/power_states/testcase.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ common:
1313
peak_padding: 40
1414
measurement_duration: 6
1515
num_of_transitions: 4
16-
expected_rms_values: [56.0, 4.0, 1.2, 0.26, 140]
16+
expected_rms_values: [5.6, 0.4, 0.14, 0.026, 14]
1717
tolerance_percentage: 20
1818
record:
1919
regex:

tests/subsys/pm/power_wakeup_timer/testcase.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ common:
1313
peak_padding: 40
1414
measurement_duration: 2
1515
num_of_transitions: 1
16-
expected_rms_values: [0.26, 140]
16+
expected_rms_values: [0.026, 14]
1717
tolerance_percentage: 20
1818
record:
1919
regex:

0 commit comments

Comments
 (0)