Skip to content

Commit

Permalink
Fail test case when huge page is not enough, and add huge page cleanup.
Browse files Browse the repository at this point in the history
Signed-off-by: liang-cong-red-hat <[email protected]>
  • Loading branch information
liang-cong-red-hat committed Sep 26, 2024
1 parent 768eab4 commit 3b51e5d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions libvirt/tests/src/memory/memory_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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):
"""
Expand Down

0 comments on commit 3b51e5d

Please sign in to comment.