提交 44648d12 编写于 作者: Y Yumei Huang

qemu.tests: Add case for nvdimm backed by host emulated device

Signed-off-by: NYumei Huang <yuhuang@redhat.com>
上级 05e5ebde
......@@ -4,6 +4,7 @@
maxmem_mem = 32G
kill_vm_on_error = yes
login_timeout = 240
only x86_64
no Windows
no RHEL.6 RHEL.5 RHEL.4 RHEL.3
no RHEL.7.2 RHEL.7.1 RHEL.7.0
......@@ -27,3 +28,11 @@
variants:
- nvdimm_basic:
- nvdimm_emulate:
# Please update host kernel line first, such as add "memmap=1G!5G":
# 1G is the size, 5G is the start address of host memory
start_vm = "no"
nv_backend = "/dev/pmem0"
mem-path = ${nv_backend}
del pre_command
del post_command
import os
import logging
from autotest.client.shared import error
from avocado.utils import process
from virttest import env_process
class NvdimmTest(object):
......@@ -101,6 +105,18 @@ def run(test, params, env):
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment.
"""
if params["start_vm"] == "no":
error.context("Check nvdimm backend in host", logging.info)
try:
process.system("grep 'memmap=' /proc/cmdline")
except process.CmdError:
raise error.TestError("Please add kernel param 'memmap' before start test.")
if not os.path.exists(params["nv_backend"]):
raise error.TestError("Check nv_backend in host failed!")
params["start_vm"] = "yes"
vm_name = params['main_vm']
env_process.preprocess_vm(test, params, env, vm_name)
nvdimm_test = NvdimmTest(params, env)
vm = env.get_vm(params["main_vm"])
vm.verify_alive()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册