Skip to content

Commit

Permalink
keywords.robot & CPU-performance-lib: remove unused kwds
Browse files Browse the repository at this point in the history
Signed-off-by: Filip Gołaś <[email protected]>
  • Loading branch information
philipandag committed Dec 17, 2024
1 parent f31ee95 commit f9378d9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 71 deletions.
66 changes: 0 additions & 66 deletions keywords.robot
Original file line number Diff line number Diff line change
Expand Up @@ -484,26 +484,6 @@ Get All USB
${count}= Evaluate ${count_usb}+${external_count}
RETURN ${count}

Prepare Lm-sensors
[Documentation] Install lm-sensors and probe sensors.
Detect Or Install Package lm-sensors
Execute Command In Terminal sudo sensors-detect --auto
IF '${PLATFORM}' == 'raptor-cs_talos2'
Execute Command In Terminal modprobe w83795
END

Get Fan Speed
[Documentation] Returns current fan speed as int.
# Detect or Install Package lm-sensors
# Execute Command In Terminal yes | sudo sensors-detect
# Execute Command In Terminal modprobe w83795
${speed}= Execute Command In Terminal sensors | grep fan1
${speed}= Get Lines Containing String ${speed} RPM)
${speed_split}= Split String ${speed}
${rpm}= Get From List ${speed_split} 1
${rpm}= Convert To Number ${rpm}
RETURN ${rpm}

Prepare Test Suite
[Documentation] Keyword prepares Test Suite by importing specific
... platform configuration keywords and variables and
Expand Down Expand Up @@ -764,25 +744,6 @@ Get USB Devices Windows
${out}= Execute Command In Terminal Get-PnpDevice -PresentOnly | Where-Object { $_.InstanceId -match '^USB' }
RETURN ${out}

Get CPU Temperature And CPU Fan Speed
[Documentation] Get the current CPU temperature in Celsius degrees and
... the current CPU fan speed in rpms.
${output}= Telnet.Execute Command sensors w83795g-i2c-1-2f |grep fan1 -A 16
${rpm}= Get Lines Containing String ${output} fan1
${rpm}= Split String ${rpm} ${SPACE}
${rpm}= Get Substring ${rpm} -8 -7
${rpm}= Get From List ${rpm} 0
${rpm_value}= Convert To Integer ${rpm}
${temperature}= Get Lines Containing String ${output} temp7
${temperature}= Split String ${temperature} ${SPACE}
${temperature}= Get Substring ${temperature} -8 -7
${temperature}= Get From List ${temperature} 0
${temperature}= Remove String ${temperature} +
${temperature}= Remove String ${temperature} °
${temperature}= Remove String ${temperature} C
${temperature_value}= Convert To Number ${temperature}
RETURN ${rpm_value} ${temperature_value}

Execute Linux Command Without Output
[Documentation] Execute linux command over serial console. Do not return
... standard output. There is one optional argument. The
Expand Down Expand Up @@ -1522,33 +1483,6 @@ Calculate Smoothing
Log To Console From Temp: ${expected_speed_percentage}%
Should Be True ${low_limit} < ${pwm} < ${high_limit}

Get PWM Value
[Documentation] Returns current PWN value from hwmon.
# ../hwmon/hwmonX/pwm{1,2}
${hwmon}= Execute Command In Terminal
... ls /sys/devices/LNXSYSTM\:00/LNXSYBUS\:00/17761776\:00/hwmon | grep hwmon
${pwm}= Execute Command In Terminal cat /sys/devices/LNXSYSTM:00/LNXSYBUS:00/17761776:00/hwmon/${hwmon}/pwm1
${pwm}= Convert To Number ${pwm}
RETURN ${pwm}

Get Temperature CURRENT
[Documentation] Get current temperature from hwmon.
${hwmon}= Execute Command In Terminal
... ls /sys/devices/LNXSYSTM\:00/LNXSYBUS\:00/17761776\:00/hwmon | grep hwmon
${temperature}= Execute Command In Terminal
... cat /sys/devices/LNXSYSTM:00/LNXSYBUS:00/17761776:00/hwmon/${hwmon}/temp1_input
${temperature}= Evaluate ${temperature[:2]}
${temperature}= Convert To Number ${temperature}
RETURN ${temperature}

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
RETURN ${rpm}

Disable Option In Submenu
[Documentation] Disables selected option in submenu provided in ${menu_construction}
[Arguments] ${menu_construction} ${option_str}
Expand Down
9 changes: 4 additions & 5 deletions lib/CPU-performance-lib.robot
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
*** Settings ***
Resource sensors.robot


*** Keywords ***
Get CPU Frequency MAX
[Documentation] Get max CPU Frequency.
Expand All @@ -21,11 +25,6 @@ Get CPU Frequency MIN
${freq}= Evaluate ${freq}-100
RETURN ${freq}

Get CPU Temperature CURRENT
[Documentation] Get current CPU temperature.
${temperature}= Execute Command In Terminal sensors 2>/dev/null | awk -F '[+°]' '/Package id 0:/ {printf $2}'
RETURN ${temperature}

Get CPU Frequencies In Ubuntu
[Documentation] Get all CPU frequencies in Ubuntu OS. Keyword returns
... list of current CPU frequencies
Expand Down

0 comments on commit f9378d9

Please sign in to comment.