Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
start_vm = "no"
expr_driver = "mlx5_vfio_pci"
ping_dest = "www.redhat.com"
test_pf = "ens3f0np0"

need_sriov = "yes"
vf_no = 4
only x86_64, aarch64

x86_64:
test_pf = "ens3f0np0"

variants:
- mlx5_vfio:
driver_dict = {'driver': {'driver_attr': {'name': 'vfio', 'model': 'mlx5_vfio_pci'}}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
status_error = "yes"
migrate_vm_back = "no"
postcopy_options = "--postcopy --timeout 10 --timeout-postcopy"
err_msg = "VFIO migration is not supported with postcopy migration"
err_msg = "VFIO migration is not supported|cannot migrate domain.*VFIO migration is not supported"
- without_postcopy:
postcopy_options = ""
variants:
Expand Down
8 changes: 2 additions & 6 deletions libvirt/tests/src/bios/boot_order_ovmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,14 @@ def check_boot(vm, test, params):
time.sleep(3)
if not status_error:
try:
vm.cleanup_serial_console()
vm.create_serial_console()
vm.wait_for_serial_login()
vm.wait_for_serial_login(recreate_serial_console=True)
except Exception as error:
test.fail(f"Test fail: {error}")
else:
test.log.debug("Succeed to boot %s", vm.name)
else:
try:
vm.cleanup_serial_console()
vm.create_serial_console()
vm.wait_for_serial_login()
vm.wait_for_serial_login(recreate_serial_console=True)
except LoginTimeoutError as expected_e:
test.log.debug(f"Got expected error message: {expected_e}")
except Exception as e:
Expand Down
8 changes: 2 additions & 6 deletions libvirt/tests/src/bios/boot_order_seabios.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,18 +270,14 @@ def run(test, params, env):
internal_timeout=0.5)
else:
time.sleep(3)
vm.cleanup_serial_console()
vm.create_serial_console()
vm.wait_for_serial_login(timeout=15)
vm.wait_for_serial_login(timeout=15, recreate_serial_console=True)
except Exception as e:
test.fail(f"Test fail: {str(e)}")
else:
test.log.debug("Succeed to boot %s", vm_name)
else:
try:
vm.cleanup_serial_console()
vm.create_serial_console()
vm.wait_for_serial_login(timeout=15)
vm.wait_for_serial_login(timeout=15, recreate_serial_console=True)
except LoginTimeoutError as expected_e:
test.log.debug("Got expected error message: %s", str(expected_e))
except Exception as exc:
Expand Down
6 changes: 1 addition & 5 deletions libvirt/tests/src/migration/migrate_mem.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,11 +279,7 @@ def verify_test_back_mem_nvdimm(vm, params, test):
:param test: test object
"""
vm.connect_uri = params.get("virsh_migrate_connect_uri")
if vm.serial_console is not None:
test.log.debug("clean up old serial console")
vm.cleanup_serial_console()
vm.create_serial_console()
vm_session = vm.wait_for_serial_login(timeout=240)
vm_session = vm.wait_for_serial_login(timeout=240, recreate_serial_console=True)
cmd = 'mount -o dax /dev/pmem0 /mnt'
vm_session.cmd(cmd)
expected_content = params.get('test_file_content') + '.back'
Expand Down
15 changes: 3 additions & 12 deletions libvirt/tests/src/migration/migrate_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,7 @@ def create_fake_tap(remote_session):
vm_xml.VMXML.new_from_dumpxml(vm_name))

# Check local guest network connection before migration
if vm.serial_console is not None:
vm.cleanup_serial_console()
vm.create_serial_console()
vm_session = vm.wait_for_serial_login(timeout=240)
vm_session = vm.wait_for_serial_login(timeout=240, recreate_serial_console=True)
if not utils_package.package_install('dhcp-client', session=vm_session):
test.error("Failed to install dhcp-client on guest.")
utils_net.restart_guest_network(vm_session)
Expand All @@ -343,10 +340,7 @@ def create_fake_tap(remote_session):
# Check network accessibility after migration
if int(mig_result.exit_status) == 0:
vm.connect_uri = dest_uri
if vm.serial_console is not None:
vm.cleanup_serial_console()
vm.create_serial_console()
vm_session_after_mig = vm.wait_for_serial_login(timeout=240)
vm_session_after_mig = vm.wait_for_serial_login(timeout=240, recreate_serial_console=True)
vm_session_after_mig.cmd(restart_dhclient)
check_vm_network_accessed(ping_dest, session=vm_session_after_mig)

Expand Down Expand Up @@ -393,10 +387,7 @@ def create_fake_tap(remote_session):
logging.debug("VM is migrated back.")

vm.connect_uri = bk_uri
if vm.serial_console is not None:
vm.cleanup_serial_console()
vm.create_serial_console()
vm_session_after_mig_bak = vm.wait_for_serial_login(timeout=240)
vm_session_after_mig_bak = vm.wait_for_serial_login(timeout=240, recreate_serial_console=True)
vm_session_after_mig_bak.cmd(restart_dhclient)
check_vm_network_accessed(ping_dest, vm_session_after_mig_bak)
finally:
Expand Down
4 changes: 1 addition & 3 deletions libvirt/tests/src/migration/migrate_with_panic_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ def verify_test():
migration_obj.verify_default()

backup_uri, vm.connect_uri = vm.connect_uri, dest_uri
vm.cleanup_serial_console()
vm.create_serial_console()
remote_vm_session = vm.wait_for_serial_login(timeout=360)
remote_vm_session = vm.wait_for_serial_login(timeout=360, recreate_serial_console=True)
try:
remote_vm_session.cmd("systemctl stop kdump", ignore_all_errors=True)
remote_vm_session.cmd("echo 1 > /proc/sys/kernel/sysrq")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ def verify_test():
expect_str = params.get("expect_str")

backup_uri, vm.connect_uri = vm.connect_uri, desturi
vm.cleanup_serial_console()
vm.create_serial_console()
vm_session = vm.wait_for_serial_login(timeout=120)
vm_session = vm.wait_for_serial_login(timeout=120, recreate_serial_console=True)
output = vm_session.cmd_output("df -h")
vm_session.close()
test.log.debug("output: %s", output)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ def verify_test():
mnt_path_name = params.get("mnt_path_name")

backup_uri, vm.connect_uri = vm.connect_uri, desturi
vm.cleanup_serial_console()
vm.create_serial_console()
vm_session = vm.wait_for_serial_login(timeout=120)
vm_session = vm.wait_for_serial_login(timeout=120, recreate_serial_console=True)
output = vm_session.cmd_output("df -h")
test.log.debug("output: %s", output)
if not re.search(expect_str, output):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,8 @@ def check_vtpm_func(params, vm, test, on_remote=False):
src_uri = params.get("virsh_migrate_connect_uri")
test.log.debug("Check vtpm func: (on_remote: %s).", on_remote)
if on_remote:
if vm.serial_console is not None:
vm.cleanup_serial_console()
vm.connect_uri = dest_uri
if vm.serial_console is None:
vm.create_serial_console()
vm_session = vm.wait_for_serial_login(timeout=240)
vm_session = vm.wait_for_serial_login(timeout=240, recreate_serial_console=True)
if not utils_package.package_install("tpm2-tools", vm_session):
test.error("Failed to install tpm2-tools in vm")
cmd_result = vm_session.cmd_status(tpm_cmd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,8 @@ def check_vtpm_func(params, vm, test, remote=False):
src_uri = params.get("virsh_migrate_connect_uri")
test.log.debug("Check vtpm func: %s (remote).", remote)
if remote:
if vm.serial_console is not None:
vm.cleanup_serial_console()
vm.connect_uri = dest_uri
if vm.serial_console is None:
vm.create_serial_console()
vm_session = vm.wait_for_serial_login(timeout=240)
vm_session = vm.wait_for_serial_login(timeout=240, recreate_serial_console=True)
if not utils_package.package_install("tpm2-tools", vm_session):
test.error("Failed to install tpm2-tools in vm")
cmd_result = vm_session.cmd_status(tpm_cmd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,8 @@ def check_vtpm_func(params, vm, test, remote=False):
src_uri = params.get("virsh_migrate_connect_uri")
test.log.debug("Check vtpm func: %s (remote).", remote)
if remote:
if vm.serial_console is not None:
vm.cleanup_serial_console()
vm.connect_uri = dest_uri
if vm.serial_console is None:
vm.create_serial_console()
vm_session = vm.wait_for_serial_login(timeout=240)
vm_session = vm.wait_for_serial_login(timeout=240, recreate_serial_console=True)
if not utils_package.package_install("tpm2-tools", vm_session):
test.error("Failed to install tpm2-tools in vm")
cmd_result = vm_session.cmd_status(tpm_cmd)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ def verify_test():

test.log.info("Verify steps.")
backup_uri, vm.connect_uri = vm.connect_uri, dest_uri
vm.cleanup_serial_console()
vm.create_serial_console()
remote_vm_session = vm.wait_for_serial_login(timeout=360)
remote_vm_session = vm.wait_for_serial_login(timeout=360, recreate_serial_console=True)
remote_vm_dmesg = remote_vm_session.cmd_output("dmesg")
if "I/O error" in remote_vm_dmesg:
test.fail(f"Found I/O error in guest dmesg: {remote_vm_dmesg}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,8 @@ def check_disk(params, vm):
disk_target1 = params.get("disk_target1")
disk_target2 = params.get("disk_target2")

vm.cleanup_serial_console()
backup_uri, vm.connect_uri = vm.connect_uri, dest_uri
vm.create_serial_console()
remote_vm_session = vm.wait_for_serial_login(timeout=120)
remote_vm_session = vm.wait_for_serial_login(timeout=120, recreate_serial_console=True)
utils_disk.linux_disk_check(remote_vm_session, disk_target1)
utils_disk.linux_disk_check(remote_vm_session, disk_target2)

Expand Down
4 changes: 1 addition & 3 deletions libvirt/tests/src/nwfilter/nwfilter_binding_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ def attach_new_device():
utlv.check_result(ret, expected_match=[r"vnet\d+\s+clean-traffic"])
utlv.check_result(ret, expected_match=[r"vnet\d+\s+allow-dhcp-server"])
# detach a interface, before detach, make sure guest boot up
vm.cleanup_serial_console()
vm.create_serial_console()
vm.wait_for_serial_login().close
vm.wait_for_serial_login(recreate_serial_console=True).close()
option = "--type network" + " --mac " + new_iface_1.mac_address
ret = virsh.detach_interface(vm_name, option, debug=True)
time.sleep(time_wait)
Expand Down
4 changes: 1 addition & 3 deletions libvirt/tests/src/snapshot/revert_disk_external_snap.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ def revert_snap_and_check_files(params, vm, test, snap_name, expected_files):

virsh.snapshot_revert(vm.name, snap_name, options=options, **virsh_dargs)

vm.cleanup_serial_console()
vm.create_serial_console()
session = vm.wait_for_serial_login()
session = vm.wait_for_serial_login(recreate_serial_console=True)
for file in expected_files:
output = session.cmd('ls %s' % file)
if file not in output:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ def check_file_exist(test, vm, params, revert_snap):

if not vm.is_alive():
virsh.start(vm_name)
vm.cleanup_serial_console()
vm.create_serial_console()
session = vm.wait_for_serial_login()
session = vm.wait_for_serial_login(recreate_serial_console=True)

if revert_snap == "1":
file_list = eval(params.get("file_list"))[0:1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ def run_test():

test.log.info("TEST_STEP2: Start the VM")
vm.start()
vm.cleanup_serial_console()
vm.create_serial_console()
vm_session = vm.wait_for_serial_login(timeout=240)
vm_session = vm.wait_for_serial_login(timeout=240, recreate_serial_console=True)

test.log.info("TEST_STEP3: Check interface quantity and network"
"accessibility.")
Expand Down
12 changes: 3 additions & 9 deletions libvirt/tests/src/sriov/failover/sriov_failover_lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ def run_test():

test.log.info("TEST_STEP2: Start the VM")
vm.start()
vm.cleanup_serial_console()
vm.create_serial_console()
vm_session = vm.wait_for_serial_login(timeout=240)
vm_session = vm.wait_for_serial_login(timeout=240, recreate_serial_console=True)

test.log.info("TEST_STEP3: Check network accessibility")
check_points.check_vm_network_accessed(vm_session,
Expand Down Expand Up @@ -67,9 +65,7 @@ def run_test():
virsh.restore(save_file, debug=True, ignore_status=False)
if not libvirt.check_vm_state(vm_name, "running"):
test.fail("The guest should be running after executing 'virsh restore'.")
vm.cleanup_serial_console()
vm.create_serial_console()
vm_session = vm.wait_for_serial_login()
vm_session = vm.wait_for_serial_login(recreate_serial_console=True)

test.log.info("TEST_STEP7: Check network accessibility")
check_points.check_vm_network_accessed(vm_session,
Expand All @@ -80,9 +76,7 @@ def run_test():
test.log.info("TEST_STEP8: Managedsave the VM.")
virsh.managedsave(vm_name, debug=True, ignore_status=False, timeout=10)
vm.start()
vm.cleanup_serial_console()
vm.create_serial_console()
vm_session = vm.wait_for_serial_login()
vm_session = vm.wait_for_serial_login(recreate_serial_console=True)

test.log.info("TEST_STEP9: Check network accessibility")
check_points.check_vm_network_accessed(vm_session,
Expand Down
4 changes: 1 addition & 3 deletions libvirt/tests/src/sriov/failover/sriov_failover_migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ def verify_network():
"""
Verify network function
"""
vm.cleanup_serial_console()
vm.create_serial_console()
vm_session = vm.wait_for_serial_login(timeout=240)
vm_session = vm.wait_for_serial_login(timeout=240, recreate_serial_console=True)
check_points.check_vm_iface_num(vm_session, expr_iface_no,
timeout=40, first=15)

Expand Down
Loading