提交 e9d7db15 编写于 作者: S Suqin Huang

Add more scenerios to win virtio driver test

上级 9568e469
- win_virtio_driver_update_test:
type = win_virtio_driver_update_test
type = driver_in_use
only Windows
monitor_type = qmp
monitors = qmp1
......@@ -12,10 +12,28 @@
need_enable_verifier = yes
need_clear_verifier = yes
driver_install_timeout = 600
suppress_exception = no
tmp_folder = C:\tmp
guest_alias = "Win7-32:w7\x86,Win7-64:w7\amd64,Win8-32:w8\x86,Win8-64:w8\amd64,Win8.1-32:w8.1\x86,Win8-64.1:w8.1\amd64,Win10-32:w10\x86,Win10-64:w10\amd64,Win2008-32:2k8\x86,Win2008-64:2k8\amd64,Win2012-64:2k12\amd64,Win2012-64r2:2k12R2\amd64"
driver_install_cmd = "python WIN_UTILS:\win_driver_install.py %s %s %s %s %s"
show_file_ext_cmd = "reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced /v HideFileExt /t REG_DWORD /d 0 /f"
read_rng_cmd = "X:\random_%PROCESSOR_ARCHITECTURE%.exe"
sub_test = win_virtio_driver_update_test
variants:
- uninstall_install:
need_uninstall = yes
- downgrade_upgrade:
need_uninstall = no
cdrom_virtio_downgrade = isos/windows/virtio-win-downgrade.iso
variants:
- before_bg_test:
run_bg_flag = "before_bg_test"
- during_bg_test:
run_bg_flag = "during_bg_test"
read_rng_cmd = for /l %i in (1, 1, 1000) do "X:\random_%PROCESSOR_ARCHITECTURE%.exe"
suppress_exception = yes
- after_bg_test:
run_bg_flag = "after_bg_test"
variants:
- with_balloon:
driver_name = balloon
......@@ -25,7 +43,7 @@
driver_name = balloon
device_name = "VirtIO Balloon Driver"
driver_id_pattern = "(.*?):.*?VirtIO Balloon Driver"
sub_test = balloon_check
run_bgstress = balloon_check
virtio_balloon_pause = 10.0
free_mem_cmd = cat /proc/meminfo |grep MemFree
ratio = 0.5
......@@ -40,7 +58,7 @@
nic_model_nic2 = rtl8139
device_name = "Red Hat VirtIO Ethernet Adapter"
hostpassword = redhat
sub_test = netperf_stress
run_bgstress = netperf_stress
netperf_link = netperf-2.6.0.tar.bz2
server_path = /var/tmp/
client_path = /var/tmp/
......@@ -55,7 +73,7 @@
- with_viostor:
driver_name = viostor
device_name = "Red Hat VirtIO SCSI controller"
sub_test = iozone_windows
run_bgstress = iozone_windows
drive_format_image1 = ide
images += " stg"
image_name_stg = "images/storage"
......@@ -73,6 +91,7 @@
- with_vioscsi:
driver_name = vioscsi
device_name = "Red Hat VirtIO SCSI pass-through controller"
run_bgstress = iozone_windows
drive_format_image1 = ide
images += " stg"
image_name_stg = "images/storage"
......@@ -87,9 +106,12 @@
iozone_cmd = "WIN_UTILS:\Iozone\iozone.exe -azR -r 64k -n 1G -g 2G -M -i 0 -i 1 -b iozone.xls -f ${disk_letter}:\testfile"
iozone_timeout = 7200
wait_bg_time = 180
variants:
- uninstall_install:
need_uninstall = yes
- downgrade_upgrade:
need_uninstall = no
cdrom_virtio_downgrade = isos/windows/virtio-win-downgrade.iso
- with_viorng:
no no_virtio_rng
driver_name = viorng
device_name = "VirtIO RNG Device"
run_bgstress = rng_bat
target_process = random\w*.exe
session_cmd_timeout = 240
rng_data_rex = "0x\w"
driver_id_pattern = "(.*?):.*?VirtIO RNG Device"
import logging
from virttest import utils_test
from virttest import error_context
from qemu.tests import single_driver_install
......@@ -24,47 +23,27 @@ def run(test, params, env):
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment
"""
driver = params["driver_name"]
timeout = int(params.get("login_timeout", 360))
sub_test = params.get("sub_test")
cdrom_virtio_downgrade = params.get("cdrom_virtio_downgrade")
vm = env.get_vm(params["main_vm"])
vm.verify_alive()
error_context.context("Boot guest with %s device" % driver, logging.info)
session = vm.wait_for_login(timeout=timeout)
if params.get("need_enable_verifier", "yes") == "yes":
error_context.context("Enable %s driver verifier in guest" % driver,
logging.info)
session = utils_test.qemu.setup_win_driver_verifier(session,
driver, vm, timeout)
try:
if params.get("need_uninstall") == "yes":
error_context.context("Uninstall virtio driver", logging.info)
single_driver_install.run(test, params, env)
# Need install driver after uninstallation.
params["need_uninstall"] = False
error_context.context("Install virtio driver", logging.info)
else:
error_context.context("Downgrade virtio driver", logging.info)
new_params = params.copy()
new_params["cdrom_virtio"] = cdrom_virtio_downgrade
vm.create(params=new_params)
vm.verify_alive()
single_driver_install.run(test, new_params, env)
if sub_test:
error_context.context("Run sub test %s" % sub_test, logging.info)
utils_test.run_virt_sub_test(test, new_params, env, sub_test)
error_context.context("Upgrade virtio driver to original",
logging.info)
vm.create(params=params)
vm.verify_alive()
if params.get("need_uninstall") == "yes":
error_context.context("Uninstall virtio driver", logging.info)
single_driver_install.run(test, params, env)
finally:
if params.get("need_clear_verifier", "yes") == "yes":
error_context.context("Clear %s driver verifier in guest" % driver,
logging.info)
session = utils_test.qemu.clear_win_driver_verifier(session,
vm, timeout)
vm.destroy()
# Need install driver after uninstallation.
params["need_uninstall"] = False
error_context.context("Install virtio driver", logging.info)
else:
error_context.context("Downgrade virtio driver", logging.info)
new_params = params.copy()
new_params["cdrom_virtio"] = cdrom_virtio_downgrade
vm.create(params=new_params)
vm.verify_alive()
single_driver_install.run(test, new_params, env)
error_context.context("Upgrade virtio driver to original",
logging.info)
vm.create(params=params)
vm.verify_alive()
single_driver_install.run(test, params, env)
vm.destroy()
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册