From 2b95db3e93bca0e21aa77816cb4debe73e726198 Mon Sep 17 00:00:00 2001 From: Yumei Huang Date: Tue, 9 Jun 2020 14:12:26 +0800 Subject: [PATCH] hotplug_mem_negative: Fix 'no valid keyword' issue In case overcommit_host_mem, overcommit_mem need not exceed maxmem, otherwise, keywords won't match. Fix it by set maxmem to a large value. Signed-off-by: Yumei Huang --- qemu/tests/cfg/hotplug_mem_negative.cfg | 1 + qemu/tests/hotplug_mem_negative.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/qemu/tests/cfg/hotplug_mem_negative.cfg b/qemu/tests/cfg/hotplug_mem_negative.cfg index 9657ebcd..4ac98cfd 100644 --- a/qemu/tests/cfg/hotplug_mem_negative.cfg +++ b/qemu/tests/cfg/hotplug_mem_negative.cfg @@ -14,6 +14,7 @@ variants: - overcommit_host_mem: size_mem = + maxmem_mem = 8T keywords = "Cannot allocate memory" - min_mem_size: size_mem = 0G diff --git a/qemu/tests/hotplug_mem_negative.py b/qemu/tests/hotplug_mem_negative.py index f6998f6d..23590bbf 100644 --- a/qemu/tests/hotplug_mem_negative.py +++ b/qemu/tests/hotplug_mem_negative.py @@ -58,10 +58,10 @@ def run(test, params, env): def check_msg(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_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)) if params["policy_mem"] == "bind": params["host-nodes"] = str(max(memory.numa_nodes()) + 1) -- GitLab