Skip to content

Commit

Permalink
Merge pull request #3798 from zhenyzha/check_block_mem
Browse files Browse the repository at this point in the history
hotplug_mem_repeat:Update size_mem acquisition method
  • Loading branch information
YongxueHong authored Sep 11, 2023
2 parents 8957c9e + 8f8d7e6 commit f986ae3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion qemu/tests/cfg/hotplug_memory_repeat.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
no WinXP Win2000 Win2003 WinVista
slots_mem = 256
mem_fixed = 4096
x86_64:
aarch64,x86_64:
mem_fixed = 8192
size_mem = 128M
maxmem_mem = 40G
Expand All @@ -24,6 +24,13 @@
maxmem_mem = 70G
backend_mem = memory-backend-ram
repeat_times = 256
aarch64:
# Section size must be at least 128MB for 4K and 16k base
# page size config.
# Section size must be at least 512MB for 64K base
get_basic_page = "getconf PAGE_SIZE"
size_mem_64k = 512M
maxmem_mem = 140G
variants test_type:
- repeat_256:
only Linux
Expand Down
8 changes: 7 additions & 1 deletion qemu/tests/hotplug_mem_repeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from virttest import error_context
from virttest import utils_test

from virttest.utils_test.qemu import MemoryHotplugTest

LOG_JOB = logging.getLogger('avocado.test')
Expand Down Expand Up @@ -35,12 +36,17 @@ def start_test(self):
memory 256 times, then unplug 256 times. Otherwise, repeat hotplug
and unplug in turn for 256 times. This is test entry.
"""
times = int(self.params["repeat_times"])
times = self.params.get_numeric("repeat_times", int)
target_mems = []
for i in range(times):
target_mems.append("mem%s" % i)
vm = self.env.get_vm(self.params["main_vm"])
session = vm.wait_for_login()
if self.params.get("vm_arch_name", "") == "aarch64":
self.test.log.info("Check basic page size on guest.")
get_basic_page = self.params.get("get_basic_page")
if session.cmd(get_basic_page).strip() == '65536':
self.params['size_mem'] = self.params.get("size_mem_64k")
if self.params.get_boolean("mem_unplug_test", False):
arg = "movable_node"
utils_test.update_boot_option(vm, args_added=arg)
Expand Down

0 comments on commit f986ae3

Please sign in to comment.