public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] runpwtests03:skip read check for cpufreq/stats/reset file
@ 2017-11-20  8:01 shuang.qiu
  2017-11-20 11:52 ` Alexey Kodanev
  0 siblings, 1 reply; 3+ messages in thread
From: shuang.qiu @ 2017-11-20  8:01 UTC (permalink / raw)
  To: ltp

From: Shuang Qiu <shuang.qiu@oracle.com>

According to the cpufreq-stats doc,cpufreq/stats/reset is
write-only attribute of cpu freq sysfs file.
So skip the cat checking for this file.

Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
---
 testcases/kernel/power_management/runpwtests03.sh |    1 +
 1 file changed, 1 insertion(+)

diff --git a/testcases/kernel/power_management/runpwtests03.sh b/testcases/kernel/power_management/runpwtests03.sh
index d4ea88b..00f6e02 100755
--- a/testcases/kernel/power_management/runpwtests03.sh
+++ b/testcases/kernel/power_management/runpwtests03.sh
@@ -35,6 +35,7 @@ check_cpufreq_sysfs_files() {
 			-name "*" -type f)
 		for files in ${cpufiles}
 		do
+			[ "$files" = "/sys/devices/system/cpu/cpu${cpu}/cpufreq/stats/reset" ] && continue
 			cat ${files} >/dev/null 2>&1
 			if [ $? -ne 0 ] ; then
 				echo "${0}: FAIL: cat ${files}"
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [LTP] [PATCH] runpwtests03:skip read check for cpufreq/stats/reset file
  2017-11-20  8:01 [LTP] [PATCH] runpwtests03:skip read check for cpufreq/stats/reset file shuang.qiu
@ 2017-11-20 11:52 ` Alexey Kodanev
  2017-11-21  5:04   ` Shuang Qiu
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Kodanev @ 2017-11-20 11:52 UTC (permalink / raw)
  To: ltp

On 11/20/2017 11:01 AM, shuang.qiu@oracle.com wrote:
> From: Shuang Qiu <shuang.qiu@oracle.com>
>
> According to the cpufreq-stats doc,cpufreq/stats/reset is
> write-only attribute of cpu freq sysfs file.
> So skip the cat checking for this file.
>
> Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
> ---
>  testcases/kernel/power_management/runpwtests03.sh |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/testcases/kernel/power_management/runpwtests03.sh b/testcases/kernel/power_management/runpwtests03.sh
> index d4ea88b..00f6e02 100755
> --- a/testcases/kernel/power_management/runpwtests03.sh
> +++ b/testcases/kernel/power_management/runpwtests03.sh
> @@ -35,6 +35,7 @@ check_cpufreq_sysfs_files() {
>  			-name "*" -type f)
>  		for files in ${cpufiles}
>  		do
> +			[ "$files" = "/sys/devices/system/cpu/cpu${cpu}/cpufreq/stats/reset" ] && continue
>  			cat ${files} >/dev/null 2>&1

May be better update the above 'find' command to match only files that
have read permission, e.g. add '-readable' option?

Thanks,
Alexey


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [LTP] [PATCH] runpwtests03:skip read check for cpufreq/stats/reset file
  2017-11-20 11:52 ` Alexey Kodanev
@ 2017-11-21  5:04   ` Shuang Qiu
  0 siblings, 0 replies; 3+ messages in thread
From: Shuang Qiu @ 2017-11-21  5:04 UTC (permalink / raw)
  To: ltp

On 11/20/2017 07:52 PM, Alexey Kodanev wrote:
> On 11/20/2017 11:01 AM, shuang.qiu@oracle.com wrote:
>> From: Shuang Qiu <shuang.qiu@oracle.com>
>>
>> According to the cpufreq-stats doc,cpufreq/stats/reset is
>> write-only attribute of cpu freq sysfs file.
>> So skip the cat checking for this file.
>>
>> Signed-off-by: Shuang Qiu <shuang.qiu@oracle.com>
>> ---
>>   testcases/kernel/power_management/runpwtests03.sh |    1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/testcases/kernel/power_management/runpwtests03.sh b/testcases/kernel/power_management/runpwtests03.sh
>> index d4ea88b..00f6e02 100755
>> --- a/testcases/kernel/power_management/runpwtests03.sh
>> +++ b/testcases/kernel/power_management/runpwtests03.sh
>> @@ -35,6 +35,7 @@ check_cpufreq_sysfs_files() {
>>   			-name "*" -type f)
>>   		for files in ${cpufiles}
>>   		do
>> +			[ "$files" = "/sys/devices/system/cpu/cpu${cpu}/cpufreq/stats/reset" ] && continue
>>   			cat ${files} >/dev/null 2>&1
> May be better update the above 'find' command to match only files that
> have read permission, e.g. add '-readable' option?
Thanks Alexey.

That is a better solution.
-readable option takes into account access control lists and other 
permissions artefacts which the -perm test ignores,may not work here.
-perm /400 option should work.
I will send another patch.

Thanks
Shuang
>
> Thanks,
> Alexey
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-11-21  5:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-20  8:01 [LTP] [PATCH] runpwtests03:skip read check for cpufreq/stats/reset file shuang.qiu
2017-11-20 11:52 ` Alexey Kodanev
2017-11-21  5:04   ` Shuang Qiu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox