Skip to content

Commit

Permalink
qemu_guest_agent: adjust change for the version name of mingw-qga
Browse files Browse the repository at this point in the history
the name of qemu-ga-win has been changed to mingw-qemu-ga-win,
so the logic of getting specific version of package should be
adjusted as well.

Signed-off-by: Dehan Meng <[email protected]>
  • Loading branch information
6-dehan committed Feb 22, 2024
1 parent 6ec52d3 commit ac2fe14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions qemu/tests/cfg/qemu_guest_agent.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
gagent_download_cmd = "wget https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-qemu-ga/${qemu_ga_pkg} -O ${gagent_host_path}"
gagent_download_url = "https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/latest-qemu-ga/${qemu_ga_pkg} -O ${gagent_host_path}"
gagent_guest_dir = "C:\qemu-ga"
src_qgarpm_path= "qemu-ga-win*.rpm"
src_qgarpm_path= "%s*.rpm"
installrpm_getmsi = "rpm -Uvh --nodeps --force %s > /dev/null"
get_qgamsi_path = "rpm -ql qemu-ga-win | grep msi"
get_qgamsi_path = "rpm -ql %s | grep msi"
gagent_install_cmd = "start /wait %s /quiet"
gagent_uninstall_cmd = wmic product where name='Qemu guest agent' call uninstall
gagent_start_cmd = "net start qemu-ga"
Expand Down
8 changes: 6 additions & 2 deletions qemu/tests/qemu_guest_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -3933,13 +3933,18 @@ def get_qga_pkg_path(self, qemu_ga_pkg, test, session, params, vm):
if self.gagent_src_type == "url":
gagent_host_path = params["gagent_host_path"]
gagent_download_url = params["gagent_download_url"]
mqgaw_ver = re.search(r'(?:\d+\.){2}\d+', gagent_download_url)
mqgaw_ver_list = list(map(int, mqgaw_ver.group(0).split('.')))
mqgaw_name = "mingw-qemu-ga-win" if mqgaw_ver_list >= [105, 0, 1] else "qemu-ga-win"
src_qgarpm_path = params["src_qgarpm_path"] % mqgaw_name
cmd_get_qgamsi_path = params["get_qgamsi_path"] % mqgaw_name
qga_msi = params['qemu_ga_pkg']
rpm_install = "rpm_install" in gagent_download_url
if rpm_install:
gagent_download_url = gagent_download_url.split("rpm_install:")[-1]
gagent_download_cmd = 'wget -qP %s %s' % (gagent_host_path,
gagent_download_url)
gagent_host_path += params["src_qgarpm_path"]
gagent_host_path += src_qgarpm_path
else:
gagent_host_path += qga_msi
gagent_download_cmd = 'wget %s %s' % (gagent_host_path,
Expand All @@ -3959,7 +3964,6 @@ def get_qga_pkg_path(self, qemu_ga_pkg, test, session, params, vm):
if rpm_install:
get_qga_msi = params["installrpm_getmsi"] % gagent_host_path
process.system(get_qga_msi, shell=True, timeout=10)
cmd_get_qgamsi_path = params["get_qgamsi_path"]
qgamsi_path = process.system_output(cmd_get_qgamsi_path,
shell=True)
qgamsi_path = qgamsi_path.decode(encoding="utf-8",
Expand Down

0 comments on commit ac2fe14

Please sign in to comment.