From 1a81d1656c33e69bc1349b20a9cdf3ac1b7ecb14 Mon Sep 17 00:00:00 2001 From: Mike Qiu Date: Tue, 16 Jul 2013 03:40:59 -0700 Subject: [PATCH] qemu.balloon_check: reset the memory to origin value The memory should be reset to the origin value after evict or enlarge. So that the next iterations tests can pass when check memory before test Signed-off-by: Mike Qiu --- qemu/tests/balloon_check.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qemu/tests/balloon_check.py b/qemu/tests/balloon_check.py index 084640d3..f83faa5b 100644 --- a/qemu/tests/balloon_check.py +++ b/qemu/tests/balloon_check.py @@ -219,4 +219,14 @@ def run_balloon_check(test, params, env): ballooned_mem = 0 memory_check("after subtest when enlarging memory", ballooned_mem, monitor_boot_mem , guest_boot_mem, ratio) + + # we should reset the memory to the origin value, so that next + # iterations can pass when check memory before test + error.context("Reset the memory to monitor boot memory", logging.info) + + balloon_memory(monitor_boot_mem) + ballooned_mem = vm_assigned_mem - monitor_boot_mem + memory_check("after reset memory", ballooned_mem, + monitor_boot_mem, guest_boot_mem, ratio) + session.close() -- GitLab