未验证 提交 a32ac58b 编写于 作者: Y Yanan Fu 提交者: GitHub

Merge pull request #2263 from huangyum/hp_neg

hotplug_mem_negative: Fix 'no valid keyword' issue
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
variants: variants:
- overcommit_host_mem: - overcommit_host_mem:
size_mem = <overcommit> size_mem = <overcommit>
maxmem_mem = 8T
keywords = "Cannot allocate memory" keywords = "Cannot allocate memory"
- min_mem_size: - min_mem_size:
size_mem = 0G size_mem = 0G
......
...@@ -58,10 +58,10 @@ def run(test, params, env): ...@@ -58,10 +58,10 @@ def run(test, params, env):
def check_msg(keywords, msg): def check_msg(keywords, msg):
if not re.search(r"%s" % keywords, msg): if not re.search(r"%s" % keywords, msg):
test.fail("No invalid keywords were found in the qemu prompt message") test.fail("No valid keywords were found in the qemu prompt message")
if params["size_mem"] == "<overcommit>": if params["size_mem"] == "<overcommit>":
overcommit_mem = normalize_data_size("%sK" % (memory.memtotal() * 1.2), "G") overcommit_mem = normalize_data_size("%sK" % (memory.memtotal() * 2), "G")
params["size_mem"] = "%sG" % round(float(overcommit_mem)) params["size_mem"] = "%sG" % round(float(overcommit_mem))
if params["policy_mem"] == "bind": if params["policy_mem"] == "bind":
params["host-nodes"] = str(max(memory.numa_nodes()) + 1) params["host-nodes"] = str(max(memory.numa_nodes()) + 1)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册