Skip to content

Commit 9d2dbd3

Browse files
maluka-dmytroshuahkh
authored andcommitted
selftests/cpu-hotplug: Fix check for cpu hotplug not supported
If CONFIG_HOTPLUG_CPU is disabled, /sys/devices/system/cpu/cpu* directories are still populated, so the test fails to correctly detect that CPU hotplug is not supported. Fix this by checking for the presence of 'online' files in those directories instead. The 'online' node is created for the given CPU if and only if this CPU supports hotplug. So if none of the CPUs have 'online' nodes, it means CPU hotplug is not supported. Signed-off-by: Dmytro Maluka <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Shuah Khan <[email protected]>
1 parent 64fac99 commit 9d2dbd3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ prerequisite()
2424
exit $ksft_skip
2525
fi
2626

27-
if ! ls $SYSFS/devices/system/cpu/cpu* > /dev/null 2>&1; then
27+
if ! ls $SYSFS/devices/system/cpu/cpu*/online > /dev/null 2>&1; then
2828
echo $msg cpu hotplug is not supported >&2
2929
exit $ksft_skip
3030
fi

0 commit comments

Comments
 (0)