[LTP] [PATCH 3/3] pounder/cpufreq: Skip the test if processors are not supported by cpufreq

Li Wang
2015-08-18T08:37:06Z

During the pounder21/cpufreq test, it print so many errors:

[2015-08-17 08:43:24] (17818) cpufreq.bin: FAIL with code 4.
[2015-08-17 08:43:24] (17818) cpufreq.bin: START loop #2.
[2015-08-17 08:43:25] (17812) cpufreq.bin: FAIL with code 4.
[2015-08-17 08:43:25] (17812) cpufreq.bin: START loop #2.
[2015-08-17 08:43:27] (17812) cpufreq.bin: FAIL with code 4.
...

The reason is that the case canceled some cpufreq check steps before,
now reuse them to make sure it could be skiped on a system without
cpufreq support.

Signed-off-by: Li Wang <liwang@redhat.com>
---
tools/pounder21/test_scripts/cpufreq | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/pounder21/test_scripts/cpufreq b/tools/pounder21/test_scripts/cpufreq
index ba94a76..4df70a9 100755
--- a/tools/pounder21/test_scripts/cpufreq
+++ b/tools/pounder21/test_scripts/cpufreq
@@ -21,12 +21,12 @@

# Do any CPU support cpufreq?
-#CPUFREQ_ENABLED_CPUS=`/bin/ls -lad /sys/devices/system/cpu/cpu*/cpufreq 2> /dev/null | wc -l`
+CPUFREQ_ENABLED_CPUS=`/bin/ls -lad /sys/devices/system/cpu/cpu*/cpufreq 2> /dev/null | wc -l`

-#if [ "$CPUFREQ_ENABLED_CPUS" -lt 1 ]; then
-# echo "None of your CPUs support cpufreq. Bye."
-# exit 255
-#fi
+if [ "$CPUFREQ_ENABLED_CPUS" -lt 1 ]; then
+ echo "None of your CPUs support cpufreq. Bye."
+ exit 255
+fi

# Turn on acpi_pstate_strict to ensure that state transitions actually happen...
if [ -f /sys/module/acpi_cpufreq/parameters/acpi_pstate_strict ]; then