From: Po-Hsu Lin Date: Thu, 10 Aug 2017 06:32:00 +0000 (+0200) Subject: selftests: check hot-pluggagble memory for memory-hotplug test X-Git-Tag: Ubuntu-4.10.0-34.38~16 X-Git-Url: https://git.proxmox.com/?p=mirror_ubuntu-zesty-kernel.git;a=commitdiff_plain;h=fae61a8729e6c61541e363236d53e688e9419af0 selftests: check hot-pluggagble memory for memory-hotplug test BugLink: http://bugs.launchpad.net/bugs/1710868 Check for hot-pluggable memory availability in prerequisite() of the memory-hotplug test. Signed-off-by: Po-Hsu Lin Signed-off-by: Shuah Khan (cherry picked from commit a34b28c92ec8c92938de03c18c5fab32efd2e29a) Signed-off-by: Po-Hsu Lin Acked-by: Stefan Bader Acked-by: Kleber Sacilotto de Souza Signed-off-by: Kleber Sacilotto de Souza --- diff --git a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh index a8d858767102..993ff2bcfc7b 100755 --- a/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh +++ b/tools/testing/selftests/memory-hotplug/mem-on-off-test.sh @@ -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 } #