Skip to content

Commit

Permalink
Merge pull request #5896 from mxie91/add-case-for-virt-v2v-in-place
Browse files Browse the repository at this point in the history
Add v2v case about virt-v2v-in-place
  • Loading branch information
xiaodwan authored Sep 14, 2024
2 parents d20151d + 960f6c0 commit ad9830b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
10 changes: 10 additions & 0 deletions v2v/tests/cfg/convert_from_file.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
output_method = "rhev"
- local:
only dest_local
- none:
only dest_none
variants:
- input_mode:
variants:
Expand All @@ -50,6 +52,14 @@
- latest8:
boottype = 3
image_url = "LATEST_RHEL8_IMAGE_URL_V2V_EXAMPLE"
- virt_v2v_in_place:
only output_mode.none
boottype = 3
image_url = "LATEST_RHEL9_IMAGE_URL_V2V_EXAMPLE"
checkpoint = 'virt_v2v_in_place'
msg_content = 'virt-v2v-in-place: warning: virt-v2v-in-place is NOT SUPPORTED .*? use virt-v2v instead of this tool.'
expect_msg = yes
skip_vm_check = yes
- libvirtxml:
only source_none
input_mode = "libvirtxml"
Expand Down
9 changes: 7 additions & 2 deletions v2v/tests/src/convert_from_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ def vm_check():
log_fail('fail to download guest image from libvirt-ci resource')
image_name = re.search(r'RHEL-\S*\w*.qcow2', params.get('image_url')).group()
v2v_params.update({'input_file': os.path.join(tmp_path, image_name)})
if checkpoint == 'virt_v2v_in_place':
output = utils_v2v.cmd_run('/usr/libexec/virt-v2v-in-place -i disk %s/%s' % (tmp_path, image_name))
log_check = utils_v2v.check_log(params, output.stdout_text)
if log_check:
log_fail(log_check)
if output_format:
v2v_params.update({'of_format': output_format})
# Create libvirt dir pool
Expand Down Expand Up @@ -331,8 +336,8 @@ def vm_check():

if 'new_name' in v2v_params:
vm_name = params['main_vm'] = v2v_params['new_name']

check_result(v2v_result, status_error)
if checkpoint != 'virt_v2v_in_place':
check_result(v2v_result, status_error)
finally:
# Cleanup constant files
utils_v2v.cleanup_constant_files(params)
Expand Down

0 comments on commit ad9830b

Please sign in to comment.