Files
bootrr/helpers/assert_cpufreq_enabled
Mark Brown 6ac3e34d34 helpers: Fix bashism in cpufreq and cpuidle tests
The helpers for verifiying that cpufreq and cpuidle are enabled
use let which is a bash extension and not supported in standard
POSIX shell, including with busybox.  Convert to use expr which
is standard.

Signed-off-by: Mark Brown <broonie@kernel.org>
2023-01-17 22:53:16 -06:00

20 lines
343 B
Bash
Executable File

#!/bin/sh
. bootrr
TEST_CASE_ID="$1"
NUM_CPUS="$2"
if [ -z "${TEST_CASE_ID}" -o -z "${NUM_CPUS}" ]; then
echo "Usage: $0 <test-case-id> <#cpus>"
exit 1
fi
CPU=0
while [ $CPU -le $NUM_CPUS ]; do
[ -f /sys/devices/system/cpu/cpu${CPU}/cpufreq/scaling_driver ] || test_report_exit fail
CPU=$(expr ${CPU} + 1)
done
test_report_exit pass