Skip to content

Commit

Permalink
debug some cases
Browse files Browse the repository at this point in the history
Signed-off-by: lcheng <[email protected]>
  • Loading branch information
cliping committed Nov 1, 2023
1 parent fb07719 commit e2e3a4d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@
status_error = "no"
service_name = "libvirtd"
service_operations = "restart"
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "virsh.domjobabort", "func_param": "'%s --postcopy' % params.get('migrate_main_vm')", "need_sleep_time": "5"}, {"func": "libvirt_service.control_service", "func_param": "params", "need_sleep_time": "5"}, {"func": "set_migrate_speed_to_high", "func_param": "params"}, {"func": "do_migration", "func_param": "params"}]'
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "virsh.domjobabort", "func_param": "'%s --postcopy' % params.get('migrate_main_vm')", "need_sleep_time": "5"}, {"func": "libvirt_service.control_service", "func_param": "params", "need_sleep_time": "5"}, {"func": "set_migrate_speed_to_high", "func_param": "params"}, {"func": "do_migration", "func_param": "params", "need_sleep_time": "3"}]'
- restart_dest_virtqemud:
status_error = "no"
service_name = "libvirtd"
service_on_dst = "yes"
service_operations = "restart"
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "virsh.domjobabort", "func_param": "'%s --postcopy' % params.get('migrate_main_vm')", "need_sleep_time": "60"}, {"func": "libvirt_service.control_service", "func_param": "params", "need_sleep_time": "5"}, {"func": "set_migrate_speed_to_high", "func_param": "params", "need_sleep_time": "60"}, {"func": "do_migration", "func_param": "params"}]'
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "virsh.domjobabort", "func_param": "'%s --postcopy' % params.get('migrate_main_vm')", "need_sleep_time": "60"}, {"func": "libvirt_service.control_service", "func_param": "params", "need_sleep_time": "5"}, {"func": "set_migrate_speed_to_high", "func_param": "params", "need_sleep_time": "5"}, {"func": "do_migration", "func_param": "params", "need_sleep_time": "2"}]'
- kill_dest_qemu:
status_error = "yes"
status_error_during_mig = "yes"
service_name = "qemu-kvm"
service_on_dst = "yes"
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "virsh.domjobabort", "func_param": "'%s --postcopy' % params.get('migrate_main_vm')", "need_sleep_time": "5"}, {"func": "libvirt_service.kill_service", "func_param": "params", "need_sleep_time": "5"}, {"func": "set_migrate_speed_to_high", "func_param": "params"}, {"func": "do_migration", "func_param": "params"}]'
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "virsh.domjobabort", "func_param": "'%s --postcopy' % params.get('migrate_main_vm')", "need_sleep_time": "5"}, {"func": "libvirt_service.kill_service", "func_param": "params", "need_sleep_time": "5"}, {"func": "set_migrate_speed_to_high", "func_param": "params"}, {"func": "do_migration", "func_param": "params", "need_sleep_time": "3"}]'
- destroy_dest_vm:
status_error = "yes"
status_error_during_mig = "yes"
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "virsh.domjobabort", "func_param": "'%s --postcopy' % params.get('migrate_main_vm')", "need_sleep_time": "5"}, {"func": "destroy_dest_vm", "func_param": "params", "need_sleep_time": "3"}, {"func": "set_migrate_speed_to_high", "func_param": "params"}, {"func": "do_migration", "func_param": "params"}]'
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "virsh.domjobabort", "func_param": "'%s --postcopy' % params.get('migrate_main_vm')", "need_sleep_time": "5"}, {"func": "destroy_dest_vm", "func_param": "params", "need_sleep_time": "3"}, {"func": "set_migrate_speed_to_high", "func_param": "params"}, {"func": "do_migration", "func_param": "params", "need_sleep_time": "3"}]'
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@
virsh_migrate_migrateuri = "unix://${migrateuri_socket_path}"
virsh_migrate_disks_uri = "unix://${disks_uri_socket_path}"
virsh_migrate_extra = "--migrateuri ${virsh_migrate_migrateuri}"
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "virsh.domjobabort", "func_param": "'%s --postcopy' % params.get('migrate_main_vm')", "need_sleep_time": "5"}, {"func": "clear_pmsocat", "func_param": "params"}, {"func": "do_migration", "func_param": "params", "need_sleep_time": "60"}, {"func": "base_steps.recreate_conn_objs", "func_param": "params"}, {"func": "resume_migration_again", "func_param": "params"}]'
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "virsh.domjobabort", "func_param": "'%s --postcopy' % params.get('migrate_main_vm')", "need_sleep_time": "5"}, {"func": "clear_pmsocat", "func_param": "params"}, {"func": "do_migration", "func_param": "params", "need_sleep_time": "60"}, {"func": "base_steps.recreate_conn_objs", "func_param": "params"}, {"func": "resume_migration_again", "func_param": "params", "need_sleep_time": "3"}]'
check_port_or_network_conn_num = "no"
err_msg_during_mig = "Failed to connect socket to .*: Connection refused"
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from virttest import utils_net

from virttest.utils_libvirt import libvirt_config
from virttest.utils_test import libvirt

from provider.migration import base_steps
from provider.migration import migration_base
Expand Down Expand Up @@ -180,13 +181,19 @@ def cleanup_migration_address():
Cleanup for migration_address case
"""
ipv4_env_on_target = "yes" == params.get("ipv4_env_on_target", "no")
remote_ip = params.get("server_ip", params.get("remote_ip"))
remote_pwd = params.get("server_pwd", params.get("remote_pwd"))
remote_user = params.get("server_user", params.get("remote_user"))

test.log.info("Cleanup for migration_address case.")
migration_obj.cleanup_connection()
global qemu_conf_remote
if qemu_conf_remote:
test.log.info("Recover remote qemu configurations")
del qemu_conf_remote
libvirt.remotely_control_libvirtd(remote_ip, remote_user,
remote_pwd, action='restart',
status_error='no')
global remove_key_remote
if remove_key_remote:
del remove_key_remote
Expand Down
11 changes: 6 additions & 5 deletions provider/migration/base_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,9 @@ def setup_connection(self):
migrate_desturi_port = self.params.get("migrate_desturi_port")
migrate_desturi_type = self.params.get("migrate_desturi_type", "tcp")

if migrate_desturi_port:
self.remote_add_or_remove_port(migrate_desturi_port)

if migrate_desturi_type:
self.conn_list.append(migration_base.setup_conn_obj(migrate_desturi_type, self.params, self.test))

Expand All @@ -319,8 +322,6 @@ def setup_connection(self):
if transport_type_again and transport_type_again not in [transport_type, migrate_desturi_type]:
self.conn_list.append(migration_base.setup_conn_obj(transport_type_again, self.params, self.test))

if migrate_desturi_port:
self.remote_add_or_remove_port(migrate_desturi_port)
self.setup_default()

def cleanup_connection(self):
Expand All @@ -331,9 +332,9 @@ def cleanup_connection(self):
migrate_desturi_port = self.params.get("migrate_desturi_port")

self.cleanup_default()
migration_base.cleanup_conn_obj(self.conn_list, self.test)
if migrate_desturi_port:
self.remote_add_or_remove_port(migrate_desturi_port, add=False)
migration_base.cleanup_conn_obj(self.conn_list, self.test)

def set_remote_log(self):
"""
Expand Down Expand Up @@ -401,8 +402,8 @@ def remote_add_or_remove_port(self, port, add=True):
firewall_cmd.add_port(port, 'tcp', permanent=True)
else:
firewall_cmd.remove_port(port, 'tcp', permanent=True)
# Wait for 2 seconds to make the firewall take effect
time.sleep(2)
# Wait for 3 seconds to make the firewall take effect
time.sleep(3)
remote_session.close()


Expand Down

0 comments on commit e2e3a4d

Please sign in to comment.