Skip to content

Commit 86db9a1

Browse files
zhijianli88Shuah Khan
authored andcommitted
selftests/cpu-hotplug: Skip test when there is only one online cpu
For only one online cpu case, 'make run_tests' try to offline the cpu0 that will always fail since the host can't offline this unique online cpu. this patch will skip the test to avoid this failure. Signed-off-by: Li Zhijian <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 8fe6e53 commit 86db9a1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ prerequisite()
2828
echo "CPU online/offline summary:"
2929
online_cpus=`cat $SYSFS/devices/system/cpu/online`
3030
online_max=${online_cpus##*-}
31+
32+
if [[ "$online_cpus" = "$online_max" ]]; then
33+
echo "$msg: since there is only one cpu: $online_cpus"
34+
exit 0
35+
fi
36+
3137
echo -e "\t Cpus in online state: $online_cpus"
3238

3339
offline_cpus=`cat $SYSFS/devices/system/cpu/offline`

0 commit comments

Comments
 (0)