From 960f6c0dd623f212f4e507ad5ad569232c1441f3 Mon Sep 17 00:00:00 2001 From: Ming Xie Date: Fri, 13 Sep 2024 04:26:46 -0400 Subject: [PATCH] Add case about virt-v2v-in-place Signed-off-by: Ming Xie --- v2v/tests/cfg/convert_from_file.cfg | 10 ++++++++++ v2v/tests/src/convert_from_file.py | 9 +++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/v2v/tests/cfg/convert_from_file.cfg b/v2v/tests/cfg/convert_from_file.cfg index 1546632d79..9673cc847e 100644 --- a/v2v/tests/cfg/convert_from_file.cfg +++ b/v2v/tests/cfg/convert_from_file.cfg @@ -37,6 +37,8 @@ output_method = "rhev" - local: only dest_local + - none: + only dest_none variants: - input_mode: variants: @@ -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" diff --git a/v2v/tests/src/convert_from_file.py b/v2v/tests/src/convert_from_file.py index ffbb649933..4a41a29e8d 100644 --- a/v2v/tests/src/convert_from_file.py +++ b/v2v/tests/src/convert_from_file.py @@ -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 @@ -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)