summaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
authorLi Zhijian <lizhijian@cn.fujitsu.com>2017-08-14 09:28:16 +0800
committerShuah Khan <shuahkh@osg.samsung.com>2017-08-16 17:48:18 -0600
commit86db9a11f39585e36978348410a01feb25e56be8 (patch)
treec49f16950b0d689b0389679b1d2fbb23bda0436e /tools/testing
parent8fe6e53a8ed5f043ff4e6a366ebb3a641114546b (diff)
downloadlinux-stable-86db9a11f39585e36978348410a01feb25e56be8.tar.gz
linux-stable-86db9a11f39585e36978348410a01feb25e56be8.tar.bz2
linux-stable-86db9a11f39585e36978348410a01feb25e56be8.zip
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 <lizhijian@cn.fujitsu.com> Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'tools/testing')
-rwxr-xr-xtools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
index e5666dd366ed..b18b253d7bfb 100755
--- a/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
+++ b/tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh
@@ -28,6 +28,12 @@ prerequisite()
echo "CPU online/offline summary:"
online_cpus=`cat $SYSFS/devices/system/cpu/online`
online_max=${online_cpus##*-}
+
+ if [[ "$online_cpus" = "$online_max" ]]; then
+ echo "$msg: since there is only one cpu: $online_cpus"
+ exit 0
+ fi
+
echo -e "\t Cpus in online state: $online_cpus"
offline_cpus=`cat $SYSFS/devices/system/cpu/offline`