Skip to content

Commit

Permalink
Merge pull request autotest#5488 from cliping/update-port-reuse
Browse files Browse the repository at this point in the history
migration: Update port reuse case
  • Loading branch information
Yingshun authored Mar 18, 2024
2 parents e6acb1c + 05e2534 commit c2ce00d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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"}]'
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit c2ce00d

Please sign in to comment.