未验证 提交 f02d4e5a 编写于 作者: X Xu Han 提交者: GitHub

Merge pull request #1605 from lijinlijin/win_sigverif

win_sigverif: case for windows "sigverif" utility testing
- win_sigverif:
type = win_sigverif
only Windows
cdroms += " virtio winutils"
kill_vm = yes
run_sigverif_cmd = 'WIN_UTILS:\AutoIt3_%PROCESSOR_ARCHITECTURE%.exe WIN_UTILS:\sigverif.au3'
sigverif_log = "c:\Users\Public\Documents\SIGVERIF.TXT"
check_sigverif_cmd = 'type ${sigverif_log} | findstr /i "%s"'
clean_sigverif_cmd = "del ${sigverif_log}"
variants:
- with_netkvm:
only virtio_net
driver_name = netkvm
- with_viorng:
driver_name = viorng
no_virtio_rng:
virtio_rngs += " rng0"
backend_rng0 = rng-random
backend_type = passthrough
filename_passthrough = /dev/urandom
- with_viostor:
driver_name = viostor
images += " stg"
image_name_stg = "images/storage"
image_size_stg = 1G
drive_format_stg = virtio
force_create_image_stg = yes
remove_image_stg = yes
- with_vioscsi:
driver_name = vioscsi
images += " stg"
image_name_stg = "images/storage"
image_size_stg = 1G
drive_format_stg = scsi-hd
force_create_image_stg = yes
remove_image_stg = yes
- with_vioserial:
driver_name = vioser
virtio_ports = "vs"
virtio_port_type = serialport
- with_balloon:
driver_name = balloon
balloon = balloon0
balloon_dev_devid = balloon0
balloon_dev_add_bus = yes
- with_pvpanic:
no Host_RHEL.m6
driver_name = pvpanic
- with_vioinput:
required_qemu = [2.4.0, )
no Win2008..sp2
driver_name = vioinput
inputs = input1
input_dev_bus_type_input1 = virtio
input_dev_type_input1 = mouse
import logging
import re
from virttest import error_context
from virttest import utils_test
from virttest import utils_misc
from virttest.utils_windows import system
@error_context.context_aware
def run(test, params, env):
"""
sigverif test:
1) Boot guest with related virtio devices
2) Run sigverif command(an autoit script) in guest
3) Open sigverif log and check whether driver is signed
:param test: QEMU test object
:param params: Dictionary with the test parameters
:param env: Dictionary with test environment
"""
vm = env.get_vm(params["main_vm"])
session = vm.wait_for_login()
driver_name = params["driver_name"]
session = utils_test.qemu.windrv_check_running_verifier(session, vm,
test, driver_name)
run_sigverif_cmd = utils_misc.set_winutils_letter(
session, params["run_sigverif_cmd"])
sigverif_log = params["sigverif_log"]
check_sigverif_cmd = params["check_sigverif_cmd"] % driver_name
clean_sigverif_cmd = params["clean_sigverif_cmd"]
error_context.context("Run sigverif in windows guest", logging.info)
session.cmd(clean_sigverif_cmd, ignore_all_errors=True)
status, output = session.cmd_status_output(run_sigverif_cmd)
if status != 0:
test.error(output)
if not utils_misc.wait_for(lambda: system.file_exists(session,
sigverif_log), 180, 0, 5):
test.error("sigverif logs are not created")
try:
error_context.context("Open sigverif logs and check driver signature"
" status", logging.info)
output = session.cmd_output(check_sigverif_cmd)
pattern = r"%s.sys.*\s{2,}Signed" % driver_name
if not re.findall(pattern, output, re.M):
test.fail("%s driver is not digitally signed, details info is:\n %s"
% (driver_name, output))
finally:
error_context.context("Clean sigverif logs", logging.info)
session.cmd(clean_sigverif_cmd, ignore_all_errors=True)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册