Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions v2v/tests/cfg/function_test_esx.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,14 @@
certs_src_dir = 'CERTS_DIR_V2V_EXAMPLE'
certs_dest_dir = '/etc/pki/ca-trust/source/anchors'
vcenter_fdqn = VCENTER_FDQN_V2V_EXAMPLE
- verify_custom_path_cert:
only esx_80
version_required = "[libvirt-10.10.0-7.6,)"
boottype = 3
main_vm = VM_NAME_NON_ADMIN_V2V_EXAMPLE
checkpoint = 'verify_custom_path_cert'
certs_src_dir = 'CERTS_DIR_V2V_EXAMPLE'
vcenter_fdqn = VCENTER_FDQN_V2V_EXAMPLE
- luks_mapper:
only esx_70
version_required = "[virt-v2v-2.3.4-3,)"
Expand Down
18 changes: 15 additions & 3 deletions v2v/tests/cfg/specific_kvm.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -306,19 +306,31 @@
- vmtools_spausedd:
only esx_70
main_vm = VM_NAME_OPEM_VM_TOOLS_DEPEND_SPAUSEDD_V2V_EXAMPLE
- check_pnp_service:
only esx_80
version_required = "[virt-v2v-2.7.1-10,)"
skip_vm_check = yes
skip_reason = "it's a customer guest and we don't know login info"
boottype = 2
main_vm = VM_NAME_WIN_GUEST_WITH_GPO_SPECIFIC_SERVICES_V2V_EXAMPLE
checkpoint = check_pnp_service
- ubuntu_usr_partition:
only esx_80
boottype = 2
main_vm = VM_NAME_UBUNTU_WITH_USR_PARTITION_V2V_EXAMPLE
variants:
- positive_test:
status_error = 'no'
# Convert specific VM to rhev
variants:
- linux:
no default
no multi_disks.windows
no network.e1000
no fstab.invalid
no display.mix
no win_rootonlinux
no non_exist_network
no check_pnp_service
- windows:
os_type = 'windows'
shutdown_command = 'shutdown /s /f /t 0'
Expand All @@ -339,8 +351,8 @@
vm_user = 'Administrator'
vm_pwd = DEFAULT_WIN_VM_PASSWORD
variants:
- multi_disks:
only multi_disks.windows
- default:
only check_pnp_service
- network:
only network.e1000,non_exist_network
- to_libvirt:
Expand Down
9 changes: 8 additions & 1 deletion v2v/tests/src/function_test_esx.py
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,7 @@ def vm_check(status_error):
auto_clean = False
if checkpoint[0] in [
'verify_certificate',
'verify_custom_path_cert',
'mismatched_uuid',
'no_uuid',
'invalid_source',
Expand Down Expand Up @@ -992,9 +993,15 @@ def vm_check(status_error):
vcenter_fdqn = params.get('vcenter_fdqn')
verify_certificate(certs_src_dir, certs_dest_dir, vcenter_fdqn, vpx_hostname)
new_cmd = v2v_result.replace('/?no_verify=1', '').replace(vpx_hostname, vcenter_fdqn)

if 'verify_custom_path_cert' in checkpoint:
certs_src_dir = params.get('certs_src_dir')
certs_dest_dir = os.path.join(data_dir.get_tmp_dir(), 'vmwarecert')
vcenter_fdqn = params.get('vcenter_fdqn')
verify_certificate(certs_src_dir, certs_dest_dir, vcenter_fdqn, vpx_hostname)
new_cmd = v2v_result.replace('/?no_verify=1', '/?cacert=%s/faea32cd.0' % certs_dest_dir).replace(vpx_hostname, vcenter_fdqn)
if checkpoint[0] in [
'verify_certificate',
'verify_custom_path_cert',
'mismatched_uuid',
'no_uuid',
'invalid_source',
Expand Down
27 changes: 27 additions & 0 deletions v2v/tests/src/specific_kvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,33 @@ def check_result(result, status_error):
test.fail('check local output failed')
if output_mode in ['null', 'json', 'local']:
return
if checkpoint == 'check_pnp_service':
log_dir = data_dir.get_tmp_dir()
dest_log = os.path.join(log_dir, 'Firstboot', 'log.txt')
process.run("virsh start %s" % vm_name, shell=True, ignore_status=True)
LOG.info("Waiting 25 minutes to wait for guest finishing reboot")
time.sleep(25 * 60)

# Now check for the log file in the next 5 minutes
LOG.info("Checking for log file in 5 minutes")
end_time = time.time() + 5 * 60
log_content = ''
while time.time() < end_time:
process.run("virsh start %s" % vm_name, shell=True, ignore_status=True)
time.sleep(60) # check every 1 minute
process.run("virsh destroy %s" % vm_name, shell=True, ignore_status=True)
process.run("virt-copy-out -d %s '/Program Files/Guestfs/Firstboot' %s" % (vm_name, log_dir),
shell=True)
log_content = process.run('cat %s' % dest_log, shell=True, ignore_status=True).stdout_text
if not os.path.exists(dest_log):
continue
# guest will finish all reboots if info uninstalling firstboot service shows in the log
if re.search(r'uninstalling firstboot service.*', log_content):
break
if not os.path.exists(dest_log):
log_fail("firstboot log is not generated")
if len(re.findall(r'The Plug and Play service is not available.*', log_content)) >= 2:
log_fail('Found drivers are not installed due to pnp services are not available')

vmchecker = VMChecker(test, params, env)
params['vmchecker'] = vmchecker
Expand Down