Skip to content

Commit

Permalink
Merge pull request #4054 from 6-dehan/for-KVMAUTOMA-2419-installpacking
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulYuuu authored Jun 4, 2024
2 parents 15c8d70 + a085b00 commit 3761abf
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions qemu/tests/qemu_guest_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import aexpect

from packaging import version
from avocado.utils import genio
from avocado.utils import path as avo_path
from avocado.utils import process
Expand All @@ -25,6 +24,7 @@
from virttest import data_dir
from virttest import storage
from virttest import qemu_migration
from virttest.utils_version import VersionInterval

from virttest.utils_windows import virtio_win
from provider.win_driver_installer_test import (uninstall_gagent,
Expand Down Expand Up @@ -1741,16 +1741,15 @@ def _change_bl(self, session):
cmd_blacklist_backup = self.params["black_file_backup"]
session.cmd(cmd_blacklist_backup)
full_qga_ver = self._get_qga_version(session, self.vm, main_ver=False)
full_qga_ver = version.parse(full_qga_ver)
value_full_qga_ver = (full_qga_ver >= version.parse("8.1.0-5"))
value_full_qga_ver = (full_qga_ver in VersionInterval('[8.1.0-5,)'))
black_list_spec = self.params["black_list_spec"]
cmd_black_list = self.params["black_list"]
black_list_change_cmd = self.params["black_list_change_cmd"]
if full_qga_ver >= version.parse("8.1.0-5"):
if value_full_qga_ver:
black_list_spec = "allow-rpcs"
cmd_black_list = self.params["black_list_new"]
black_list_change_cmd = "sed -i 's/allow-rpcs.*/allow-rpcs=%s\"/g' /etc/sysconfig/qemu-ga"
elif full_qga_ver >= version.parse("7.2.0-4"):
elif full_qga_ver in VersionInterval('[7.2.0-4,)'):
black_list_spec = "BLOCK_RPCS"
for black_cmd in cmd_black_list.split():
bl_check_cmd = self.params["black_list_check_cmd"] % (black_list_spec, black_cmd)
Expand Down Expand Up @@ -3440,11 +3439,10 @@ def bl_check(qga_cmd):
" agent service.", LOG_JOB.info)
session.cmd("cp /etc/sysconfig/qemu-ga /etc/sysconfig/qemu-ga-bk")
full_qga_ver = self._get_qga_version(session, self.vm, main_ver=False)
full_qga_ver = version.parse(full_qga_ver)
black_list_spec = "BLACKLIST_RPC"
if full_qga_ver >= version.parse("8.1.0-5"):
if full_qga_ver in VersionInterval('[8.1.0-5,)'):
black_list_spec, black_list_spec_replace = "allow-rpcs", "block-rpcs"
elif full_qga_ver >= version.parse("7.2.0-4"):
elif full_qga_ver in VersionInterval('[7.2.0-4,)'):
black_list_spec = "BLOCK_RPCS"
if black_list_spec == "allow-rpcs":
black_list_change_cmd = "sed -i 's/%s.*/%s=guest-info\"/g' /etc/sysconfig/qemu-ga" % (black_list_spec, black_list_spec_replace)
Expand Down

0 comments on commit 3761abf

Please sign in to comment.