提交 c50e888f 编写于 作者: F Feng Yang 提交者: Lucas Meneghel Rodrigues

virt test: Check windows bsod dump when unattended_install fail.

If unattended_install fail for windows guest and rename_error_image
set, image_copy will call rename the fail image. Then call
win_bsod_catch.py to check whether dump file is created in guest.
If yes, will try to analyze dump file with Windbg.

resolved conflict in  tests/image_copy.py and remove a blank space.
Signed-off-by: NFeng Yang <fyang@redhat.com>
signed-off-by: NYiqiao Pu <ypu@redhat.com>
上级 d2189a44
import os, logging
from autotest.client.shared import error
from autotest.client import utils
from virttest import utils_misc, data_dir
from virttest import utils_misc, data_dir, utils_test
def run_image_copy(test, params, env):
......@@ -15,6 +15,10 @@ def run_image_copy(test, params, env):
@param params: Dictionary with the test parameters
@param env: Dictionary with test environment.
"""
vm = env.get_vm(params["main_vm"])
if vm is not None:
vm.destroy()
mount_dest_dir = params.get('dst_dir', '/mnt/images')
if not os.path.exists(mount_dest_dir):
try:
......@@ -31,22 +35,39 @@ def run_image_copy(test, params, env):
params['image_format'])
src_path = os.path.join(mount_dest_dir, image)
dst_path = '%s/%s.%s' % (data_dir.get_data_dir(), params['image_name'], params['image_format'])
pwd = os.path.join(test.bindir, "images")
if params.get("rename_error_image", "no") == "yes":
error_image = os.path.basename(image_name) + "-error"
error_image += '.' + params['image_format']
error_dst_path = os.path.join(pwd, error_image)
mv_cmd = "/bin/mv %s %s" % (dst_path, error_dst_path)
utils.system(mv_cmd, timeout=360, ignore_status=True)
try:
error.context("Mount the NFS share directory")
if not utils_misc.mount(src, mount_dest_dir, 'nfs', 'ro'):
raise error.TestError('Could not mount NFS share %s to %s' %
(src, mount_dest_dir))
# Check the existence of source image
error.context("Check the existence of source image")
if os.path.exists("%s.xz" % src_path):
logging.debug('Copying image %s (from xz) ...', image)
cmd = "xz -cd %s.xz > %s" % (src_path, dst_path)
elif os.path.exists("%s.gz" % src_path):
logging.debug('Copying image %s (from gzip) ...', image)
cmd = "gzip -cd %s.gz > %s" % (src_path, dst_path)
elif os.path.exists(src_path):
logging.debug('Copying image %s (uncompressed) ...', image)
cmd = 'cp %s %s' % (src_path, dst_path)
else:
raise error.TestError('Could not find %s in NFS share' % src_path)
if not utils_misc.mount(src, mount_dest_dir, 'nfs', 'ro'):
raise error.TestError('Could not mount NFS share %s to %s' %
(src, mount_dest_dir))
# Check the existence of source image
if os.path.exists("%s.xz" % src_path):
logging.debug('Copying image %s (from xz) ...', image)
cmd = "xz -cd %s.xz > %s" % (src_path, dst_path)
elif os.path.exists("%s.gz" % src_path):
logging.debug('Copying image %s (from gzip) ...', image)
cmd = "gzip -cd %s.gz > %s" % (src_path, dst_path)
elif os.path.exists(src_path):
logging.debug('Copying image %s (uncompressed) ...', image)
cmd = 'cp %s %s' % (src_path, dst_path)
else:
raise error.TestError('Could not find %s in NFS share' % src_path)
utils.system(cmd)
utils.system(cmd)
finally:
if params.get("sub_type"):
params['image_name'] += "-error"
params['boot_once'] = "c"
vm.create(params=params)
utils_test.run_virt_sub_test(test, params, env,
params.get("sub_type"))
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册