未验证 提交 acc77627 编写于 作者: C chloerh 提交者: GitHub

Merge pull request #2937 from kylazhang/builtin

Add test for rng-builtin
......@@ -5,7 +5,7 @@
status_error = no
variants:
- hotplug_unplug:
only backend_rdm.default, backend_tcp, backend_udp
only backend_rdm.default, backend_tcp, backend_udp, backend_builtin
rng_attach_device = "yes"
variants:
- positive:
......@@ -23,6 +23,11 @@
- device_assign:
rng_attach_device = "no"
variants:
- backend_builtin:
backend_model = "builtin"
test_guest = "yes"
test_qemu_cmd = "yes"
test_guest_dump = "yes"
- backend_rdm:
test_host = "yes"
test_guest = "yes"
......
......@@ -13,13 +13,12 @@ from avocado.utils import process
from virttest import virt_vm, virsh
from virttest import utils_package
from virttest import utils_misc
from virttest import libvirt_version
from virttest.utils_test import libvirt
from virttest.libvirt_xml import vm_xml
from virttest.libvirt_xml import xcepts
from virttest.libvirt_xml.devices import rng
from virttest import libvirt_version
def run(test, params, env):
"""
......@@ -199,6 +198,7 @@ def run(test, params, env):
rng_model = dparams.get("rng_model", "virtio")
rng_rate = dparams.get("rng_rate")
backend_type = dparams.get("backend_type")
backend_model = dparams.get("backend_model")
backend_source_list = dparams.get("backend_source",
"").split()
cmd = ("ps -ef | grep %s | grep -v grep" % vm_name)
......@@ -213,6 +213,8 @@ def run(test, params, env):
src_host = source['host']
src_port = source['service']
if backend_model == "builtin":
cmd += (" | grep rng-builtin")
if chardev and src_host and src_port:
cmd += (" | grep 'chardev %s,.*host=%s,port=%s'"
% (chardev, src_host, src_port))
......@@ -307,7 +309,7 @@ def run(test, params, env):
"""
check_cmd = "hexdump /dev/hwrng"
try:
status = session.cmd_status(check_cmd, 5)
status = session.cmd_status(check_cmd, 3)
if status != 0 and exists:
test.fail("Fail to check hexdump in guest")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册