diff --git a/qemu/tests/cfg/vm_hugetlb_selftests.cfg b/qemu/tests/cfg/vm_hugetlb_selftests.cfg new file mode 100644 index 0000000000..82ce321779 --- /dev/null +++ b/qemu/tests/cfg/vm_hugetlb_selftests.cfg @@ -0,0 +1,7 @@ +- vm_hugetlb_selftests: + only Linux + only x86_64 + type = vm_hugetlb_selftests + virt_test_type = qemu + setup_hugepages = yes + kernel_path = "/home/kernel" diff --git a/qemu/tests/vm_hugetlb_selftests.py b/qemu/tests/vm_hugetlb_selftests.py new file mode 100644 index 0000000000..9bbde7202f --- /dev/null +++ b/qemu/tests/vm_hugetlb_selftests.py @@ -0,0 +1,25 @@ +from virttest import error_context + + +@error_context.context_aware +def run(test, params, env): + """ + vm_hugetlb_selftests test + 1) Execute the hugetlb kernel selftests + :param test: QEMU test object + :param params: Dictionary with the test parameters + :param env: Dictionary with test environment + """ + vm = env.get_vm(params["main_vm"]) + vm.verify_alive() + session = vm.wait_for_login() + kernel_path = params.get("kernel_path", "/home/kernel") + + error_context.base_context("Execute the hugetlb selftests", test.log.info) + session.cmd("cd %s" % kernel_path) + session.cmd("cd linux-*/tools/testing/selftests/mm") + s, o = session.cmd_status_output("sh run_vmtests.sh -t hugetlb", 180) + if s != 0: + test.fail("Error during hugetlb selftests execution: %s" % o) + + error_context.context("The hugetlb tests results: %s" % o, test.log.debug)