diff --git a/v2v/tests/cfg/convert_from_file.cfg b/v2v/tests/cfg/convert_from_file.cfg index 9673cc847e..e66db849b7 100644 --- a/v2v/tests/cfg/convert_from_file.cfg +++ b/v2v/tests/cfg/convert_from_file.cfg @@ -251,6 +251,13 @@ checkpoint = 'special_character' expect_msg = 'yes' msg_content = 'nbd_connect_uri.*No such file or directory.*' + - wrong_vmx: + only esx_80 + boottype = 3 + version_required = "[virt-v2v-2.4.0-2.el9,)" + main_vm = VM_NAME_RHEL9_V2V_EXAMPLE + checkpoint = 'wrong_vmx' + msg_content_yes = "virt-v2v: error: input file is a VMDK \(disk image\), but we are expecting a VMX \(VMware metadata\)" - no_ssh_agent: only esx_80 version_required = "[virt-v2v-2.4.0-2.el9,)" @@ -321,13 +328,13 @@ variants: - negative_test: status_error = 'yes' - only parse.SHA1,parse.SHA256,special_character + only parse.SHA1,parse.SHA256,special_character,wrong_vmx - positive_test: status_error = 'no' variants: - linux: only ova,vmx,disk - no win2008r2_ostk,aws.win2019,special_character + no win2008r2_ostk,aws.win2019,special_character,wrong_vmx - windows: os_type = 'windows' shutdown_command = 'shutdown /s /f /t 0' diff --git a/v2v/tests/src/convert_from_file.py b/v2v/tests/src/convert_from_file.py index 4a41a29e8d..2338528163 100644 --- a/v2v/tests/src/convert_from_file.py +++ b/v2v/tests/src/convert_from_file.py @@ -325,6 +325,12 @@ def vm_check(): if checkpoint == 'special_character': v2v_result = utils_v2v.cmd_run(str(utils_v2v.v2v_cmd(v2v_params, cmd_only=True)).replace('.vmx', '.vm*'), params.get('v2v_dirty_resources')) + elif checkpoint == 'wrong_vmx': + esxi_passwd_file = "/tmp/v2v_esxi_passwd" + with open(esxi_passwd_file, 'w') as f: + f.write(esxi_password) + v2v_cmd = str(utils_v2v.v2v_cmd(v2v_params, cmd_only=True) + ' -ip %s' % esxi_passwd_file) + v2v_result = utils_v2v.cmd_run(v2v_cmd.replace('.vmx', '.vmdk'), params.get('v2v_dirty_resources')) elif checkpoint == 'no_ssh_agent': esxi_passwd_file = "/tmp/v2v_esxi_passwd" with open(esxi_passwd_file, 'w') as f: