提交 bb5150a8 编写于 作者: G Gao Xiaoling

vioser_in_use: add case of vcpu hotplug

Vcpu hotplug test during data transfer via serial.
Signed-off-by: NXiaoling Gao <xiagao@redhat.com>
上级 efab5cfe
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
file_sender = guest file_sender = guest
- host_to_guest: - host_to_guest:
file_sender = host file_sender = host
- transfer_both:
only with_vcpu_hotplug
file_sender = both
variants: variants:
- with_stop_continue: - with_stop_continue:
only Windows only Windows
...@@ -50,3 +53,10 @@ ...@@ -50,3 +53,10 @@
interrupt_test = live_migration_guest interrupt_test = live_migration_guest
mig_speed = 512M mig_speed = 512M
pre_migrate = "mig_set_speed" pre_migrate = "mig_set_speed"
- with_vcpu_hotplug:
only Windows
only transfer_both
interrupt_test = vcpu_hotplug_guest
vcpu_hotplug = yes
smp = 2
vcpu_maxcpus = 8
...@@ -2,6 +2,7 @@ import re ...@@ -2,6 +2,7 @@ import re
import os import os
import signal import signal
import logging import logging
import time
from avocado.utils import process from avocado.utils import process
from virttest import utils_misc from virttest import utils_misc
...@@ -45,6 +46,21 @@ def live_migration_guest(test, params, vm, session): ...@@ -45,6 +46,21 @@ def live_migration_guest(test, params, vm, session):
vm.migrate() vm.migrate()
@error_context.context_aware
def vcpu_hotplug_guest(test, params, vm, session):
"""
Vcpu hot plug test.
"""
maxcpus = int(params["vcpu_maxcpus"])
current_cpus = int(params.get("smp", 2))
for cpuid in range(current_cpus, maxcpus):
error_context.context("hot-pluging vCPU %s" % cpuid, logging.info)
vm.hotplug_vcpu(cpu_id=cpuid)
# make the cpu hotplug has slot during data transfer
time.sleep(2)
@error_context.context_aware @error_context.context_aware
def kill_host_serial_pid(params, vm): def kill_host_serial_pid(params, vm):
""" """
...@@ -116,10 +132,21 @@ def run(test, params, env): ...@@ -116,10 +132,21 @@ def run(test, params, env):
bg_thread = run_bg_test(test, params, vm, sender) bg_thread = run_bg_test(test, params, vm, sender)
globals().get(params["interrupt_test"])(test, params, vm, session) globals().get(params["interrupt_test"])(test, params, vm, session)
# for vcpu hotplug subtest, only check guest crash.
vcpu_hotplug = params.get_boolean("vcpu_hotplug")
if vcpu_hotplug:
error_context.context("Check if guest is alive.", logging.info)
vm.verify_kernel_crash()
session = vm.wait_for_login(timeout=timeout)
session.close()
return
if bg_thread: if bg_thread:
bg_thread.join(timeout=timeout, suppress_exception=suppress_exception) bg_thread.join(timeout=timeout,
suppress_exception=suppress_exception)
if vm.is_alive(): if vm.is_alive():
kill_host_serial_pid(params, vm) kill_host_serial_pid(params, vm)
if (virtio_serial_file_transfer.transfer_data(params, vm, sender=sender) is if (virtio_serial_file_transfer.transfer_data(
not True): params, vm, sender=sender) is not True):
test.fail("Serial data transfter test failed.") test.fail("Serial data transfter test failed.")
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册