From 305c23f31d9f2c83386e66667f58a0ccb532ddd8 Mon Sep 17 00:00:00 2001 From: Sebastian Czapla Date: Tue, 17 Sep 2024 12:14:07 +0200 Subject: [PATCH] dasharo-compatibility/cpu-fan-speed-measure.robot: Add fan control tests Signed-off-by: Sebastian Czapla --- .../cpu-fan-speed-measure.robot | 84 +++++++++++++++++-- keywords.robot | 5 +- 2 files changed, 79 insertions(+), 10 deletions(-) diff --git a/dasharo-compatibility/cpu-fan-speed-measure.robot b/dasharo-compatibility/cpu-fan-speed-measure.robot index 185bf5cc2..17e6813a7 100644 --- a/dasharo-compatibility/cpu-fan-speed-measure.robot +++ b/dasharo-compatibility/cpu-fan-speed-measure.robot @@ -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 diff --git a/keywords.robot b/keywords.robot index 27d7aade9..702fb5626 100644 --- a/keywords.robot +++ b/keywords.robot @@ -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