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

qemu_guest_agent: fix bug of qga pkg installation

Sometimes the latest module comes out,
but qemu-guest-agent pkg is not ready, so it will
induce test fail.
Signed-off-by: NXiaoling Gao <xiagao@redhat.com>
上级 4a923f6c
...@@ -155,6 +155,29 @@ class QemuGuestAgentTest(BaseVirtTest): ...@@ -155,6 +155,29 @@ class QemuGuestAgentTest(BaseVirtTest):
get latest qemu-guest-agent rpm package url. get latest qemu-guest-agent rpm package url.
:return: rpm pkg list :return: rpm pkg list
""" """
def get_mdl_tag_build_status(get_mdl_tag_cmd):
"""
Get module tag and qemu-kvm build status.
"""
logging.info("Get the needed module tag.")
mdl_tag = process.system_output(get_mdl_tag_cmd,
shell=True,
timeout=query_timeout
).strip().split()[0].decode()
logging.info("Check qemu-kvm build is ready or not")
get_qemu_name_cmd = "brew list-tagged %s" % mdl_tag
get_qemu_name_cmd += " | grep qemu-kvm"
qemu_bild_name = process.system_output(get_qemu_name_cmd,
shell=True,
timeout=query_timeout
).strip().split()[0].decode()
get_build_ready_cmd = "brew buildinfo %s | grep State" % qemu_bild_name
output = process.system_output(get_build_ready_cmd,
shell=True,
timeout=query_timeout
).strip().decode()
return mdl_tag, "COMPLETE" in output
virt_module_stream = self.params.get("virt_module_stream", "") virt_module_stream = self.params.get("virt_module_stream", "")
guest_name = self.params.get("guest_name") guest_name = self.params.get("guest_name")
arch = self.params["vm_arch_name"] arch = self.params["vm_arch_name"]
...@@ -168,7 +191,7 @@ class QemuGuestAgentTest(BaseVirtTest): ...@@ -168,7 +191,7 @@ class QemuGuestAgentTest(BaseVirtTest):
except avo_path.CmdNotFoundError as detail: except avo_path.CmdNotFoundError as detail:
raise TestCancel(str(detail)) raise TestCancel(str(detail))
error_context.context("Get latest virt module tag of %s" error_context.context("Get the latest qemu-guest-agent pkg of %s"
" stream." % virt_module_stream, " stream." % virt_module_stream,
logging.info) logging.info)
# target release,such as 810,811 # target release,such as 810,811
...@@ -184,14 +207,23 @@ class QemuGuestAgentTest(BaseVirtTest): ...@@ -184,14 +207,23 @@ class QemuGuestAgentTest(BaseVirtTest):
tag_version) tag_version)
get_latest_mdl_tag_cmd = "brew list-targets |grep" get_latest_mdl_tag_cmd = "brew list-targets |grep"
get_latest_mdl_tag_cmd += " %s |sort -r |head -n 1" % platform_tag get_latest_mdl_tag_cmd += " %s |sort -r |head -n 1" % platform_tag
latest_mdl_tag = process.system_output(get_latest_mdl_tag_cmd, mdl_tag, build_s = get_mdl_tag_build_status(get_latest_mdl_tag_cmd)
shell=True,
timeout=query_timeout if not build_s:
).strip().split()[0].decode() logging.info("The qemu-kvm build's status is not ready,"
error_context.context("Get qemu-guest-agent rpm pkg url.", " so we well check it in the previous virt module")
logging.info) get_pre_mdl_tag_cmd = "brew list-targets |grep %s" % platform_tag
get_pre_mdl_tag_cmd += " |sort -r |head -n 2 |tail -n 1"
mdl_tag, build_s = get_mdl_tag_build_status(
get_pre_mdl_tag_cmd)
if not build_s:
self.test.error("Please check why the recent two modules'"
" qemu-kvm build is not ready.")
error_context.context("Get qemu-guest-agent rpm pkg"
" url of %s." % mdl_tag, logging.info)
get_brew_latest_pkg_cmd = "brew --quiet --topdir=%s" % download_root get_brew_latest_pkg_cmd = "brew --quiet --topdir=%s" % download_root
get_brew_latest_pkg_cmd += " list-tagged %s" % latest_mdl_tag get_brew_latest_pkg_cmd += " list-tagged %s" % mdl_tag
get_brew_latest_pkg_cmd += " --path --arch=%s" % arch get_brew_latest_pkg_cmd += " --path --arch=%s" % arch
get_brew_latest_pkg_cmd += " |grep qemu-guest-agent-[0-9]" get_brew_latest_pkg_cmd += " |grep qemu-guest-agent-[0-9]"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册