selftests/cpu-hotplug: exit with failure when test occured unexpected behaviors
authorLi Zhijian <lizhijian@cn.fujitsu.com>
Mon, 14 Aug 2017 01:28:15 +0000 (09:28 +0800)
committerShuah Khan <shuahkh@osg.samsung.com>
Wed, 16 Aug 2017 23:48:18 +0000 (17:48 -0600)
commit8fe6e53a8ed5f043ff4e6a366ebb3a641114546b
tree3d0f15a0234f2d757da3f2849c754c05ab83412e
parentb274e75c20f91c2d8fec43f8246282c2817f8e7c
selftests/cpu-hotplug: exit with failure when test occured unexpected behaviors

Previously, 'make run_tests -C cpu-hotplug' always PASS since cpu-on-off-test.sh
always exits 0 even though the test got some unexpected errors like below:
root@debian9:/home/lizhijian/chroot/linux/tools/testing/selftests/cpu-hotplug# make run_tests
pid 878's current affinity mask: 1
pid 878's new affinity mask: 1
CPU online/offline summary:
Cpus in online state: 0
        Cpus in offline state: 0
Limited scope test: one hotplug cpu
        (leaves cpu in the original state):
        online to offline to online: cpu 0
./cpu-on-off-test.sh: line 83: /sys/devices/system/cpu/cpu0/online: Permission denied
offline_cpu_expect_success 0: unexpected fail
./cpu-on-off-test.sh: line 78: /sys/devices/system/cpu/cpu0/online: Permission denied
online_cpu_expect_success 0: unexpected fail
selftests: cpu-on-off-test.sh [PASS]

after this patch, the test will exit with failure once it occurs some unexpected behaviors

Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/cpu-hotplug/cpu-on-off-test.sh