未验证 提交 768f6339 编写于 作者: Y Yu Yihuang 提交者: GitHub

Merge pull request #2229 from zhenyzha/mmu_basic

mmu_basic: New case to test disabling radix MMU mode on guest
- mmu_basic:
type = mmu_basic
only pseries
only Host_RHEL.m8
no RHEL.6
virt_test_type = qemu
kill_vm = yes
kernel_extra_params_remove = disable_radix
image_snapshot = yes
mmu_option = yes
variants:
- @default:
only RHEL.8
- hpt:
machine_type_extra_params = "max-cpu-compat=power8"
RHEL.7:
mmu_option = no
import logging
import re
from virttest import error_context
from virttest import utils_test
@error_context.context_aware
def run(test, params, env):
"""
Test to disabling radix MMU mode on guest.
Steps:
1) There are two options, boot up a native(radix)guest or HPT guest.
2) Check the MMU mode in the guest.
3) Adding disable radix to guest's kernel line directly then reboot guest.
4) Check again the MMU mode in the guest.
5) Check guest call trace in dmesg log.
:params test: QEMU test object.
:params params: Dictionary with the test parameters.
:params env: Dictionary with test environment.
"""
def cpu_info_match(pattern):
match = re.search(pattern, session.cmd_output("cat /proc/cpuinfo"))
return True if match else False
vm = env.get_vm(params["main_vm"])
vm.verify_alive()
session = vm.wait_for_login()
error_context.context("Check the MMU mode.", logging.info)
if cpu_info_match('MMU'):
if cpu_info_match('POWER9'):
if cpu_info_match('Radix') is False:
test.fail("mmu mode is not Radix, doesn't meet expectations.")
else:
if cpu_info_match('Hash') is False:
test.fail("mmu mode is not Hash, doesn't meet expectations.")
else:
if params["mmu_option"] == 'yes':
test.fail("There should be MMU mode.")
utils_test.update_boot_option(vm, args_added="disable_radix")
session = vm.wait_for_login()
error_context.context("Check the MMU mode.", logging.info)
if cpu_info_match('MMU'):
if cpu_info_match('Hash') is False:
test.fail("mmu mode is not Hash, mmu mode disabled failure.")
else:
if params["mmu_option"] == 'yes':
test.fail("There should be MMU mode.")
vm.verify_dmesg()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册