Skip to content

Commit

Permalink
Merge pull request #6203 from mxie91/rewrite-cases-about-checking-oga…
Browse files Browse the repository at this point in the history
…c-for-linux-guests

Rewrite v2v cases about checking ogac for linux guests
  • Loading branch information
xiaodwan authored Feb 26, 2025
2 parents d78bc51 + bc63b39 commit 5f59655
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 64 deletions.
68 changes: 24 additions & 44 deletions v2v/tests/cfg/function_test_esx.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -122,12 +122,6 @@
checkpoint = 'fstrim_warning'
msg_content = 'virt-v2v: warning: fstrim on guest filesystem /dev/.*? failed. Usually'
expect_msg = yes
- schtask:
only esx_70
checkpoint = "ogac"
virtio_win_path = "/usr/share/virtio-win/"
os_version = VM_VERSION_WIN_SCHTASKS_V2V_EXAMPLE
main_vm = VM_NAME_WIN_SCHTASKS_V2V_EXAMPLE
- OGAC_balloon:
only esx_80
only dest_libvirt
Expand Down Expand Up @@ -561,53 +555,39 @@
# ovirt-guest-agent-common
- OGAC:
checkpoint = "ogac"
virtio_win_path = EXPORT_VIRTIO_WIN_PATH_V2V_EXAMPLE
implementation_change_ver = "[virt-v2v-2.0.6-3,)"
variants:
- rhel6:
only esx_70
enable_legacy_policy = yes
qa_path = 'linux/el6'
qa_url = QEMU_GUEST_AGENT_EL6_DOWNLOAD_URL_V2V_EXAMPLE
main_vm = VM_NAME_RHEL6_V2V_EXAMPLE
only esx_70
enable_legacy_policy = yes
main_vm = VM_NAME_ESX_BUGGY_SELINUX_CONTEXT_V2V_EXAMPLE
- rhel7:
only esx_70
qa_path = 'linux/el7'
qa_url = QEMU_GUEST_AGENT_EL7_DOWNLOAD_URL_V2V_EXAMPLE
main_vm = VM_NAME_RHEL7_V2V_EXAMPLE
only esx_80
main_vm = VM_NAME_RHEL7_REPO_V2V_EXAMPLE
- rhel8:
only esx_70
qa_path = 'linux/el8'
qa_url = QEMU_GUEST_AGENT_EL8_DOWNLOAD_URL_V2V_EXAMPLE
main_vm = VM_NAME_RHEL8_V2V_EXAMPLE
only esx_80
main_vm = VM_NAME_RHEL8_REPO_V2V_EXAMPLE
boottype = 3
- rhel9:
only esx_70
version_required = "[libguestfs-1.45.6-2,)"
qa_path = 'linux/el9'
qa_url = QEMU_GUEST_AGENT_EL9_DOWNLOAD_URL_V2V_EXAMPLE
main_vm = VM_NAME_ESX70_RHEL9_V2V_EXAMPLE
only esx_80
main_vm = VM_NAME_RHEL9_REPO_V2V_EXAMPLE
boottype = 3
- rhel10:
only esx_80
main_vm = VM_NAME_RHEL10_REPO_V2V_EXAMPLE
- ubuntu:
only esx_70
version_required = "[virt-v2v-2.0.6-3,)"
qa_path = 'linux/debian'
qa_url = QEMU_GUEST_AGENT_DEBIAN_DOWNLOAD_URL_V2V_EXAMPLE
main_vm = VM_NAME_UBUNTU_V2V_EXAMPLE
only esx_70
main_vm = VM_NAME_UBUNTU_REPO_V2V_EXAMPLE
- debian:
only esx_80
version_required = "[virt-v2v-2.0.6-3,)"
qa_path = 'linux/debian'
qa_url = QEMU_GUEST_AGENT_DEBIAN_DOWNLOAD_URL_V2V_EXAMPLE
main_vm = VM_NAME_DEBIAN_V2V_EXAMPLE
only esx_80
main_vm = VM_NAME_DEBIAN_REPO_V2V_EXAMPLE
- sles:
only esx_70
qa_path = 'linux/lp151'
qa_url = QEMU_GUEST_AGENT_SUSE_DOWNLOAD_URL_V2V_EXAMPLE
main_vm = VM_NAME_SLES_V2V_EXAMPLE
only esx_80
main_vm = VM_NAME_SLES_REPO_V2V_EXAMPLE
boottype = 3
os_version = "sles"
- opensuse:
only esx_80
qa_path = 'linux/lp151'
qa_url = QEMU_GUEST_AGENT_SUSE_DOWNLOAD_URL_V2V_EXAMPLE
main_vm = VM_NAME_OPENSUSE_V2V_EXAMPLE
only esx_80
main_vm = VM_NAME_OPENSUSE_REPO_V2V_EXAMPLE
- ubuntu-openvm-tools:
only esx_70
main_vm = VM_NAME_UBUNTUTOOS_V2V_EXAMPLE
Expand Down
24 changes: 4 additions & 20 deletions v2v/tests/src/function_test_esx.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
from virttest.utils_test import libvirt
from virttest.utils_v2v import params_get
from avocado.utils import process
from avocado.utils import download
from aexpect.exceptions import ShellProcessTerminatedError, ShellTimeoutError, ShellStatusError

from provider.v2v_vmcheck_helper import VMChecker
Expand Down Expand Up @@ -308,7 +307,10 @@ def get_service_info():
Get qemu-guest-agent service info
"""
status_ptn = r'Active: active \((running|exited)\)|qemu-ga \(pid +[0-9]+\) is running'
cmd = 'service qemu-ga status;systemctl status qemu-guest-agent;systemctl status qemu-ga*'
if os_version == 'sles':
cmd = 'systemctl status qemu-guest-agent'
else:
cmd = 'service qemu-ga status;systemctl status qemu-guest-agent;systemctl status qemu-ga*'
_, output = vmcheck.run_cmd(cmd)
if not re.search(status_ptn, output):
return False
Expand Down Expand Up @@ -807,24 +809,6 @@ def vm_check(status_error):
ovirt4_path = os.path.dirname(ovirtsdk4.__file__)
dst_ovirt4_path = ovirt4_path + '.bak'
os.rename(ovirt4_path, dst_ovirt4_path)
if checkpoint[0].startswith('ogac') and 'ogac_balloon' not in checkpoint:
os.environ['VIRTIO_WIN'] = virtio_win_path
if os_type == 'linux' and not utils_v2v.multiple_versions_compare(implementation_change_ver) and \
os.path.isdir(os.getenv('VIRTIO_WIN')):
export_path = os.getenv('VIRTIO_WIN')
qemu_guest_agent_dir = os.path.join(export_path, qa_path)
if not os.path.exists(qemu_guest_agent_dir) and os.access(
export_path, os.W_OK) and qa_url:
LOG.debug(
'Not found qemu-guest-agent in virtio-win or rhv-guest-tools-iso,'
' Try to prepare it manually. This is not a permanent step, once'
' the official build includes it, this step should be removed.')
os.makedirs(qemu_guest_agent_dir)
rpm_name = os.path.basename(qa_url)
download.get_file(
qa_url, os.path.join(
qemu_guest_agent_dir, rpm_name))

if 'vddk_error' in checkpoint:
fqdn_record = params_get(params, 'fqdn_record')
with open('/etc/hosts', 'r+') as fd:
Expand Down

0 comments on commit 5f59655

Please sign in to comment.