Skip to content

Commit

Permalink
Merge pull request #6037 from mxie91/fix-failures-for-some-v2v-esx-cases
Browse files Browse the repository at this point in the history
Fix failures for some v2v fun esx cases
  • Loading branch information
xiaodwan authored Dec 4, 2024
2 parents 05f452c + b6c8db2 commit 973f549
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 21 deletions.
15 changes: 8 additions & 7 deletions v2v/tests/cfg/function_test_esx.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@
- iso_file:
checkpoint += 'iso_file'
- virtio_iso_blk:
only esx_70
only esx_80
checkpoint = "virtio_iso_blk"
virtio_win_path = '/usr/share/virtio-win/virtio-win.iso'
main_vm = VM_NAME_WIN2019_V2V_EXAMPLE
main_vm = VM_NAME_ESX80_WIN2019_V2V_EXAMPLE
os_version = "win2019"
- mac_ip:
only libvirt
Expand Down Expand Up @@ -262,9 +262,9 @@
os_version = "win2019"
boottype = 3
- rhsrvany_md5:
only esx_70
only esx_80
checkpoint = 'rhsrvany_checksum'
main_vm = VM_NAME_WIN2019_V2V_EXAMPLE
main_vm = VM_NAME_ESX80_WIN2019_V2V_EXAMPLE
os_version = 'win2019'
- external_poweroff:
only esx_70
Expand Down Expand Up @@ -478,8 +478,8 @@
skip_vm_check = yes
skip_reason = 'bz#1990808'
- resume_rhel7:
only esx_70
only rhev
only esx_80
only dest_libvirt
os_version = OS_VERSION_RESUME_RHEL7_V2V_EXAMPLE
checkpoint = resume_swap
main_vm = VM_NAME_RESUME_RHEL7_V2V_EXAMPLE
Expand Down Expand Up @@ -885,7 +885,8 @@
version_required = "[nbdkit-1.30.8-1,)"
main_vm = VM_NAME_ESX70_RHEL8_V2V_EXAMPLE
vddk_thumbprint = 'AA:2B:AD'
msg_content_yes = "error: Please verify whether the "thumbprint" parameter"
#bug RHEL-55742 was closed as NOTABUG
msg_content_yes = "server reported: VDDK "Unknown error" can be caused by several problems"
- non_admin_user:
only esx_80
main_vm = VM_NAME_NON_ADMIN_V2V_EXAMPLE
Expand Down
8 changes: 4 additions & 4 deletions v2v/tests/cfg/nbdkit/nbdkit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@
- vddk7_0:
only source_esx.esx_70..dest_none
version_required = "[nbdkit-server-1.20.4-2,)"
checkpoint = 'has_run_againt_vddk7_0'
checkpoint = 'has_run_againt_vddk'
vpx_passwd_file = "/tmp/v2v_vpx_passwd"
main_vm = VM_NAME_ESX_NBDKIT_V2V_EXAMPLE
main_vm = VM_NAME_ESX70_NBDKIT_V2V_EXAMPLE
variants:
- vpx:
vsphere_host = ${vpx_hostname}
Expand Down Expand Up @@ -173,9 +173,9 @@
- vddk8_0:
only source_esx.esx_80..dest_none
version_required = "[nbdkit-server-1.38.0-1,)"
checkpoint = 'has_run_againt_vddk7_0'
checkpoint = 'has_run_againt_vddk'
vpx_passwd_file = "/tmp/v2v_vpx_passwd"
main_vm = VM_NAME_ESX_NBDKIT_V2V_EXAMPLE
main_vm = VM_NAME_ESX80_NBDKIT_V2V_EXAMPLE
variants:
- vpx:
vsphere_host = ${vpx_hostname}
Expand Down
23 changes: 13 additions & 10 deletions v2v/tests/src/nbdkit/nbdkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_filter_stats_fd_leak():
if count > 0:
test.fail('nbdkit-stats-filter leaks %d fd' % count)

def test_has_run_againt_vddk7_0():
def test_has_run_againt_vddk():
"""
check if nbdkit --run + vddk + esx7.0 works.
"""
Expand Down Expand Up @@ -89,12 +89,15 @@ def test_has_run_againt_vddk7_0():
vddk_libdir_src = params_get(params, "vddk_libdir_src")
with tempfile.TemporaryDirectory(prefix='vddklib_') as vddk_libdir:
utils_misc.mount(vddk_libdir_src, vddk_libdir, 'nfs')
process.run('mkdir /home/vddk_libdir;cp -R %s/* %s' % (vddk_libdir, '/home/vddk_libdir'),
shell=True, ignore_status=True)
utils_misc.umount(vddk_libdir_src, vddk_libdir, 'nfs')
vddk_thumbprint = '11'
nbdkit_cmd = """
nbdkit -rfv -U - --exportname / \
--filter=cacheextents --filter=retry vddk server=%s user=%s password=+%s vm=%s \
file='%s' libdir=%s --run 'nbdinfo $uri' thumbprint=%s
""" % (vsphere_host, vsphere_user, vsphere_passwd_file, nbdkit_vm_name, nbdkit_file, vddk_libdir, vddk_thumbprint)
file='%s' libdir=/home/vddk_libdir --run 'nbdinfo $uri' thumbprint=%s
""" % (vsphere_host, vsphere_user, vsphere_passwd_file, nbdkit_vm_name, nbdkit_file, vddk_thumbprint)
# get thumbprint by a trick
cmd_result = process.run(
nbdkit_cmd, shell=True, ignore_status=True)
Expand All @@ -119,21 +122,20 @@ def test_has_run_againt_vddk7_0():
' scan-ahead=true scan-clock=true scan-size=2048 scan-forever=true'
LOG.info('nbdkit command with scan, readahead and blocksize filters:\n%s' % nbdkit_cmd)
if checkpoint == 'vddk_with_delay_close_open_option':
nbdkit_cmd = nbdkit_cmd + ' --filter=delay delay-close=40000ms delay-open=40000ms'
nbdkit_cmd = nbdkit_cmd + ' --filter=delay delay-close=400ms delay-open=400ms'
LOG.info('nbdkit command with delay-close and delay-open options:\n%s' % nbdkit_cmd)
# Run the final nbdkit command
output = process.run(nbdkit_cmd, shell=True).stdout_text
utils_misc.umount(vddk_libdir_src, vddk_libdir, 'nfs')
if checkpoint == 'vddk_stats':
if vddk_stats == 1 and not re.search(
r'VDDK function stats', output):
test.fail('failed to test vddk_stats')
if vddk_stats == 0 and re.search(
r'VDDK function stats', output):
test.fail('failed to test vddk_stats')
if checkpoint == 'has_run_againt_vddk7_0' and not re.search(
if checkpoint == 'has_run_againt_vddk' and not re.search(
r'export-size', output):
test.fail('failed to test has_run_againt_vddk7_0')
test.fail('failed to test has_run_againt_vddk')
if checkpoint == 'backend_datapath_controlpath' and re.search(r'vddk: (open|pread)', output):
test.fail('fail to test nbdkit.backend.datapath and nbdkit.backend.controlpath option')
if checkpoint == 'scan_readahead_blocksize' and re.search('error', output):
Expand Down Expand Up @@ -561,7 +563,7 @@ def cache_min_block_size():

def cve_starttls():
tmp_path = data_dir.get_tmp_dir()
process.run("yum install libtool 'dnf-command(download)' -y", shell=True, ignore_status=True)
process.run("yum install libtool rpm-build 'dnf-command(download)' -y", shell=True, ignore_status=True)
process.run('yum download --source nbdkit --destdir=%s' % tmp_path, shell=True,
ignore_status=True)
process.run('cd %s ; rpmbuild -rp %s' % (tmp_path, (process.run('ls %s/nbdkit*.src.rpm' % tmp_path, shell=True).
Expand Down Expand Up @@ -665,6 +667,7 @@ def test_evil_filter():
test.fail('fail to test evil filter')

def test_tar_filter():
process.run('yum install nbdkit-tar-filter -y', shell=True, ignore_status=True)
tmp_path = data_dir.get_tmp_dir()
image_path = os.path.join(tmp_path, 'latest-rhel9.img')
process.run('qemu-img convert -f qcow2 -O raw /var/lib/avocado/data/avocado-vt/images/jeos-27-x86_64.qcow2'
Expand Down Expand Up @@ -695,9 +698,9 @@ def check_curl_time_option():

if checkpoint == 'filter_stats_fd_leak':
test_filter_stats_fd_leak()
elif checkpoint in ['has_run_againt_vddk7_0', 'vddk_stats', 'backend_datapath_controlpath',
elif checkpoint in ['has_run_againt_vddk', 'vddk_stats', 'backend_datapath_controlpath',
'scan_readahead_blocksize', 'vddk_with_delay_close_open_option']:
test_has_run_againt_vddk7_0()
test_has_run_againt_vddk()
elif checkpoint == 'memory_max_disk_size':
test_memory_max_disk_size()
elif checkpoint == 'data_corruption':
Expand Down

0 comments on commit 973f549

Please sign in to comment.