Skip to content

Commit

Permalink
dasharo-compatibility/cpu-fan-speed-measure.robot: Add fan control tests
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Czapla <[email protected]>
  • Loading branch information
SebastianCzapla committed Dec 11, 2024
1 parent 75a7b9f commit 305c23f
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 10 deletions.
84 changes: 77 additions & 7 deletions dasharo-compatibility/cpu-fan-speed-measure.robot
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,85 @@ Suite Teardown Run Keyword


*** Test Cases ***
FAN001.001 CPU fan speed measure
[Documentation] Check whether there's a possibility to measure CPU fan
... current speed.
# TODO: Bring back these tests once ACPI driver and fw support is developed
# FAN001.001 CPU fan speed measure
# [Documentation] Check whether there's a possibility to measure CPU fan
# ... current speed.
# Skip If not ${TESTS_IN_UBUNTU_SUPPORT} FAN001.001 not supported
# Skip If not ${FAN_SPEED_MEASURE_SUPPORT} FAN001.001 not supported
# Power On
# Login To Linux
# Switch To Root User
# Prepare Lm-sensors
# ${output}= Get RPM Value From System76 Acpi
# Should Not Be Empty ${output}
# Should Not Be Equal ${output} 0

# FAN001.002 All available fans are running
# [Documentation] Check if all available fans are running
# Skip If not ${TESTS_IN_UBUNTU_SUPPORT} FAN001.001 not supported
# Skip If not ${FAN_SPEED_MEASURE_SUPPORT} FAN001.001 not supported
# Power On
# Login To Linux
# Switch To Root User
# Prepare Lm-sensors
# Execute Command In Terminal stress-ng -c $(nproc) -t 10
# ${output}= Execute Command In Terminal sensors | grep "CPU fan"
# Should Not Be Empty ${output}
# Should Not Be Equal ${output} 0

# TODO: Previously, this test was documented as FAN001.002, specific
# to Asus KGPE platforms. Determine if it possible to use this
# on other platforms.
# FAN001.003 Check if increasing CPU temperature increases CPU fan speed
# [Documentation] This test aims to verify that CPU fan speed
# ... responds properly to increasing CPU temperature.

# TODO: Determine if it is possible to get RPM values from graphics card.
# It is possible on some of the NVIDIA cards using nvidia-smi
# FAN002.001 GPU fan speed measure
# [Documentation] The fan has been configured to follow a custom curve.
# ... This test aims to verify that the fan curve is configured correctly
# ... and the fan spins up and down according to the defined values.

FAN003.001 Fans are turning off during suspend mode (ME Enabled)
[Documentation] Check for correct behavior
Skip If not ${TESTS_IN_UBUNTU_SUPPORT} FAN003.001 not supported
Skip If not ${FAN_SPEED_MEASURE_SUPPORT} FAN001.001 not supported
Power On
Set UEFI Option MeMode Enabled
Login To Linux
Switch To Root User
Prepare Lm-sensors
Detect Or Install FWTS
Log To Console \nPlease check fan state manually
Execute Command In Terminal fwts s3 -f -r /tmp/suspend_test_log.log 90
Log To Console \nFan state test ended, please note the result

FAN003.002 Fans are turning off during suspend mode (ME Soft disable)
[Documentation] Check for correct behavior
Skip If not ${TESTS_IN_UBUNTU_SUPPORT} FAN003.002 not supported
Skip If not ${FAN_SPEED_MEASURE_SUPPORT} FAN001.001 not supported
Power On
Set UEFI Option MeMode Disabled (Soft)
Login To Linux
Switch To Root User
Prepare Lm-sensors
Detect Or Install FWTS
Log To Console \nPlease check fan state manually
Execute Command In Terminal fwts s3 -f -r /tmp/suspend_test_log.log 90
Log To Console \nFan state test ended, please note the result

FAN003.003 Fans are turning off during suspend mode (ME HAP disable)
[Documentation] Check for correct behavior
Skip If not ${TESTS_IN_UBUNTU_SUPPORT} FAN003.002 not supported
Skip If not ${FAN_SPEED_MEASURE_SUPPORT} FAN001.001 not supported
Skip If not ${TESTS_IN_UBUNTU_SUPPORT} FAN001.001 not supported
Power On
Set UEFI Option MeMode Disabled (HAP)
Login To Linux
Switch To Root User
Prepare Lm-sensors
${output}= Get RPM Value From System76 Acpi
Should Not Be Empty ${output}
Should Not Be Equal ${output} 0
Detect Or Install FWTS
Log To Console \nPlease check fan state manually
Execute Command In Terminal fwts s3 -f -r /tmp/suspend_test_log.log 90
Log To Console \nFan state test ended, please note the result
5 changes: 2 additions & 3 deletions keywords.robot
Original file line number Diff line number Diff line change
Expand Up @@ -1544,9 +1544,8 @@ Get Temperature CURRENT
Get RPM Value From System76 Acpi
[Documentation] Returns current RPM value of CPU fan form driver
... system76_acpi.
${speed}= Execute Command In Terminal sensors | grep "CPU fan"
${speed_split}= Split String ${speed}
${rpm}= Get From List ${speed_split} 2
${rpm}= Execute Command In Terminal sensors | grep "CPU fan" | awk '{print $3}'
Should Not Be Empty ${rpm}
RETURN ${rpm}

Disable Option In Submenu
Expand Down

0 comments on commit 305c23f

Please sign in to comment.