selftests: check hot-pluggagble memory for memory-hotplug test
authorPo-Hsu Lin <po-hsu.lin@canonical.com>
Tue, 27 Jun 2017 06:17:12 +0000 (14:17 +0800)
committerShuah Khan <shuahkh@osg.samsung.com>
Fri, 30 Jun 2017 16:06:22 +0000 (10:06 -0600)
Check for hot-pluggable memory availability in prerequisite() of the
memory-hotplug test.

Signed-off-by: Po-Hsu Lin <po-hsu.lin@canonical.com>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/memory-hotplug/mem-on-off-test.sh

index a8d8587..993ff2b 100755 (executable)
@@ -22,6 +22,11 @@ prerequisite()
                echo $msg memory hotplug is not supported >&2
                exit 0
        fi
+
+       if ! grep -q 1 $SYSFS/devices/system/memory/memory*/removable; then
+               echo $msg no hot-pluggable memory >&2
+               exit 0
+       fi
 }
 
 #