From 3b51e5d4d57e0b1f35f3db5830e85f755b35ba2a Mon Sep 17 00:00:00 2001 From: liang-cong-red-hat Date: Wed, 25 Sep 2024 22:54:36 -0400 Subject: [PATCH] Fail test case when huge page is not enough, and add huge page cleanup. Signed-off-by: liang-cong-red-hat --- libvirt/tests/src/memory/memory_misc.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libvirt/tests/src/memory/memory_misc.py b/libvirt/tests/src/memory/memory_misc.py index 3f8369fbee..c4a0adb5e7 100644 --- a/libvirt/tests/src/memory/memory_misc.py +++ b/libvirt/tests/src/memory/memory_misc.py @@ -266,8 +266,8 @@ def _setup_mbxml(): test, pg_size=default_page_size, hp_size=pagesize, hp_list=[mount_pagesize]) vm_mem_size = vmxml.memory hp_cfg = test_setup.HugePageConfig(params) - hp_cfg.set_kernel_hugepages(pagesize, vm_mem_size // pagesize) - hp_cfg.set_kernel_hugepages(mount_pagesize, mem_device_size // mount_pagesize) + hp_cfg.set_kernel_hugepages(pagesize, vm_mem_size // pagesize, False) + hp_cfg.set_kernel_hugepages(mount_pagesize, mem_device_size // mount_pagesize, False) set_vmxml(vmxml, params) _setup_mbxml() vmxml.sync() @@ -454,6 +454,9 @@ def cleanup_test_memorybacking(case): utils_disk.umount('hugetlbfs', mount_path, 'hugetlbfs') if os.path.exists(mount_path): os.rmdir(mount_path) + hp_cfg = test_setup.HugePageConfig(params) + hp_cfg.set_kernel_hugepages(int(params.get('mount_pagesize')), 0) + hp_cfg.cleanup() def run_test_edit_mem(case): """