未验证 提交 b082e0de 编写于 作者: Y Yanan Fu 提交者: GitHub

Merge pull request #2198 from nanliu-r/boot_N_M

virtio-serial: boot guest with multiple pcis with multiple ports
import logging
from virttest import error_context
from virttest import utils_test
from qemu.tests.virtio_serial_file_transfer import transfer_data
@error_context.context_aware
def run(test, params, env):
"""
Boot guest with virtio-serial-device with multiple virtserialport
1. Boot a guest with 1 virtio-serial-bus with 3 serial ports
2. Transfer data from host to guest via port2, port3
3. Transfer data from guest to host via port2, port3
Test guest with virtio-serial-device with multiple virtserialports
Scenario 1:
1.1. Boot a guest with 1 virtio-serial-bus with 3 serial ports
1.2. Transfer data via every port
Scenario 2:
2.1. Start guest with 2 virtio-serial-pci,
2.2. Each virtio-serial-pci has 3 virtio-serial-ports
2.3. Transfer data via every port
:param test: kvm test object
:param params: Dictionary with the test parameters
......@@ -19,16 +23,20 @@ def run(test, params, env):
"""
os_type = params["os_type"]
vm = env.get_vm(params["main_vm"])
driver_name = params["driver_name"]
session = vm.wait_for_login()
vm = env.get_vm(params['main_vm'])
if os_type == "windows":
driver_name = params["driver_name"]
session = vm.wait_for_login()
session = utils_test.qemu.windrv_check_running_verifier(
session, vm, test, driver_name)
for port in params.objects("serials")[2:]:
session.close()
for port in params.objects("serials"):
port_params = params.object_params(port)
if not port_params['serial_type'].startswith('virt'):
if not port_params['serial_type'].startswith('virtserial'):
continue
params['file_transfer_serial_port'] = port
error_context.context("Transfer data with %s" % port, logging.info)
transfer_data(params, vm, sender='both')
vm.verify_alive()
vm.verify_kernel_crash()
......@@ -30,14 +30,22 @@
- from_guest_to_host:
file_sender = guest
- boot_with_multiple_virtserialports:
type = boot_N_M_virtserialports
only unix_socket
filesize = 512
variants:
- 1_N:
only unix_socket
type = boot_1_N_virtserialports
driver_name = vioser
serials += " vs2 vs3"
serial_type_vs2 = virtserialport
serial_type_vs3 = virtserialport
- N_M:
serials += " vs2 vs3 vs4 vs5 vs6"
serial_type_vs2 = virtserialport
serial_type_vs3 = virtserialport
serial_type_vs4 = virtserialport
serial_reuse_bus_vs4 = no
serial_type_vs5 = virtserialport
serial_type_vs6 = virtserialport
- max_ports:
only unix_socket
type = virtio_serial_file_transfer_max_ports
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册