diff --git a/libvirt/tests/cfg/migration_with_copy_storage/network_data_transport/tcp_port_reuse.cfg b/libvirt/tests/cfg/migration_with_copy_storage/network_data_transport/tcp_port_reuse.cfg index 9ab62113cd..e9ac7dfd43 100644 --- a/libvirt/tests/cfg/migration_with_copy_storage/network_data_transport/tcp_port_reuse.cfg +++ b/libvirt/tests/cfg/migration_with_copy_storage/network_data_transport/tcp_port_reuse.cfg @@ -24,14 +24,10 @@ migrate_desturi_port = "16509" migrate_desturi_type = "tcp" virsh_migrate_desturi = "qemu+tcp://${migrate_dest_host}/system" - port_to_check = "49153" - action_during_mig = '[{"func": "libvirt_network.check_established", "before_pause": "yes", "func_param": "params"}]' - action_during_mig_again = '[{"func": "libvirt_network.check_established", "before_pause": "yes", "func_param": "params"}]' migrate_again = "yes" migrate_again_status_error = 'no' setup_nfs = "no" nfs_mount_dir = - variants: - p2p: virsh_migrate_options = '--live --p2p --verbose' @@ -40,3 +36,12 @@ variants: - copy_storage_all: copy_storage_option = "--copy-storage-all" + variants: + - specify_port: + disks_port = "49666" + check_patterns = [r'ESTAB .*${migrate_dest_host}]:${disks_port}', r'ESTAB .*${migrate_dest_host}]:49152'] + virsh_migrate_extra = "--disks-port ${disks_port}" + - default_port: + check_patterns = [r'ESTAB .*${migrate_dest_host}]:49153', r'ESTAB .*${migrate_dest_host}]:49152'] + action_during_mig = '[{"func": "libvirt_network.check_sockets_statistics", "after_event": "block-job", "func_param": {"server_ip": "${server_ip}", "server_user": "${server_user}", "server_pwd": "${server_pwd}", "check_patterns": "${check_patterns}"}, "wait_for_after_event_timeout": "600"}]' + action_during_mig_again = '[{"func": "libvirt_network.check_sockets_statistics", "after_event": "block-job", "func_param": {"server_ip": "${server_ip}", "server_user": "${server_user}", "server_pwd": "${server_pwd}", "check_patterns": "${check_patterns}"}, "wait_for_after_event_timeout": "600"}]' diff --git a/libvirt/tests/src/migration_with_copy_storage/network_data_transport/tcp_port_reuse.py b/libvirt/tests/src/migration_with_copy_storage/network_data_transport/tcp_port_reuse.py index 219603ef79..eef6894489 100644 --- a/libvirt/tests/src/migration_with_copy_storage/network_data_transport/tcp_port_reuse.py +++ b/libvirt/tests/src/migration_with_copy_storage/network_data_transport/tcp_port_reuse.py @@ -28,17 +28,22 @@ def run_migration_again(): vm_name = params.get("migrate_main_vm") migrate_again = "yes" == params.get("migrate_again", "no") + disks_port = params.get("disks_port") vm = env.get_vm(vm_name) migration_obj = base_steps.MigrationBase(test, vm, params) try: migration_obj.setup_connection() + if disks_port: + migration_obj.remote_add_or_remove_port(disks_port) base_steps.prepare_disks_remote(params, vm) migration_obj.run_migration() if migrate_again: run_migration_again() migration_obj.verify_default() finally: + if disks_port: + migration_obj.remote_add_or_remove_port(disks_port, add=False) migration_obj.cleanup_connection() base_steps.cleanup_disks_remote(params, vm)