selftests/cpufreq: Fix cpufreq basic read and update testcases
authorSwapnil Sapkal <swapnil.sapkal@amd.com>
Wed, 30 Apr 2025 17:14:33 +0000 (17:14 +0000)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 9 May 2025 18:43:31 +0000 (12:43 -0600)
commit8ffe772076bbb6828e28705bda93ac37c8d7294c
treedc3157d9e2f9138303fe26089598be879b7d20ee
parentab4b00407dd864853516aba3cd7caed2b7c33ffd
selftests/cpufreq: Fix cpufreq basic read and update testcases

In cpufreq basic selftests, one of the testcases is to read all cpufreq
sysfs files and print the values. This testcase assumes all the cpufreq
sysfs files have read permissions. However certain cpufreq sysfs files
(eg. stats/reset) are write only files and this testcase errors out
when it is not able to read the file.
Similarily, there is one more testcase which reads the cpufreq sysfs
file data and write it back to same file. This testcase also errors out
for sysfs files without read permission.
Fix these testcases by adding proper read permission checks.

Link: https://lore.kernel.org/r/20250430171433.10866-1-swapnil.sapkal@amd.com
Reported-by: Narasimhan V <narasimhan.v@amd.com>
Signed-off-by: Swapnil Sapkal <swapnil.sapkal@amd.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/cpufreq/cpufreq.sh