浏览代码

selftests: check hot-pluggagble memory for memory-hotplug test

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>
Po-Hsu Lin 8 年之前
父节点
当前提交
a34b28c92e
共有 1 个文件被更改,包括 5 次插入0 次删除
  1. 5 0
      tools/testing/selftests/memory-hotplug/mem-on-off-test.sh

+ 5 - 0
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
 }
 
 #