提交 cfba16a4 编写于 作者: P Ping Li

qemu_disk_img: Add sync in windows

Support to sync data in windows guest.

Signed-off-by: Ping Li pingl@redhat.com
上级 e4846aa9
......@@ -11,6 +11,11 @@
image_size = 20G
# md5sum binary path
md5sum_bin = "md5sum"
Windows:
x86_64:
sync_bin = X:\Sync\sync64.exe /accepteula
i386, i686:
sync_bin = X:\Sync\sync.exe /accepteula
force_create_image = no
backup_image_before_testing = yes
restore_image_before_testing = yes
......
......@@ -71,7 +71,7 @@ class QemuImgTest(qemu_storage.QemuImg):
@error.context_aware
def __create_file(self, dst):
error.context("create tmp file on host")
logging.info("create tmp file on host")
if not self.vm:
return False
src = self.params["tmp_file_name"]
......@@ -82,6 +82,7 @@ class QemuImgTest(qemu_storage.QemuImg):
return True
def __md5sum(self, dst):
logging.info("calculate MD5 of the file")
if not self.vm:
return False
login_timeout = int(self.params.get("login_timeout", 360))
......@@ -97,12 +98,15 @@ class QemuImgTest(qemu_storage.QemuImg):
@error.context_aware
def save_file(self, dst):
login_timeout = int(self.params.get("login_timeout", 360))
cmd = self.params.get("sync_bin", "sync")
error.context("save file('%s') md5sum in guest" % dst, logging.info)
self.__create_file(dst)
login_timeout = int(self.params.get("login_timeout", 360))
session = self.vm.wait_for_login(timeout=login_timeout)
error.context("sync guest data")
cmd = "sync"
logging.info("sync guest data")
if "X:" in cmd:
vol = utils_misc.get_winutils_vol(session)
cmd = cmd.replace("X:", "%s:" % vol)
status, output = session.cmd_status_output(cmd)
if status != 0:
logging.error("Execute '%s' with failures('%s') " % (cmd, output))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册