Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug some cases #4741

Closed
wants to merge 1 commit into from
Closed
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 @@ -43,20 +43,21 @@
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"}]'
migrate_speed = "5"
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 @@ -75,7 +75,7 @@
- pause_by_network_issue:
port_to_check = "49152"
virsh_migrate_extra = "--migrateuri tcp://${migrate_dest_host}:${port_to_check} --listen-address ${migrate_dest_host}"
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${port_to_check} -j DROP"
#firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${port_to_check} -j DROP"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp --sport ${port_to_check} -j DROP"
action_during_do_mig = '[{"func": "libvirt_network.setup_firewall_rule", "func_param": "params", "need_sleep_time": "10"}, {"func": "libvirt_network.cleanup_firewall_rule", "func_param": "params", "need_sleep_time": "90"}]'
status_error_during_mig = "no"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
- network_issue:
port_to_check = "49154"
virsh_migrate_extra = "--migrateuri tcp://${migrate_dest_host}:${port_to_check} --listen-address ${migrate_dest_host}"
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${port_to_check} -j DROP"
#firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${port_to_check} -j DROP"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp --sport ${port_to_check} -j DROP"
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_network.setup_firewall_rule", "func_param": "params"}, {"func": "do_migration", "func_param": "params", "need_sleep_time": "90"}, {"func": "libvirt_network.cleanup_firewall_rule", "func_param": "params", "need_sleep_time": "5"}, {"func": "resume_migration_again", "func_param": "params", "need_sleep_time": "5"}]'
migrate_desturi_port = "16509"
Expand All @@ -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": "30"}, {"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 @@ -65,10 +65,10 @@
- qemu_layer:
port_to_check = "49155"
virsh_migrate_extra = "--migrateuri tcp://${migrate_dest_host}:${port_to_check} --listen-address ${migrate_dest_host}"
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${port_to_check} -j DROP"
#firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${port_to_check} -j DROP"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp --sport ${port_to_check} -j DROP"
err_msg = "job 'migration in' failed in post-copy phase"
- libvirt_layer:
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${migrate_desturi_port} -j DROP"
#firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${migrate_desturi_port} -j DROP"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp --sport ${migrate_desturi_port} -j DROP"
err_msg = "internal error: client socket is closed|connection closed due to keepalive timeout"
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
service_name = "virtproxyd"
service_on_dst = "yes"
- network_issue_libvirt_layer:
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${migrate_desturi_port} -j DROP"
#firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${migrate_desturi_port} -j DROP"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp --sport ${migrate_desturi_port} -j DROP"
expected_event_src = ["event 'lifecycle' for domain .*: Suspended Post-copy"]
expected_event_src_2 = ["event 'lifecycle' for domain .*: Stopped Migrated", "event 'job-completed' for domain"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
virsh_migrate_desturi = "qemu+tcp://${migrate_dest_host}/system"
port_to_check = "49152"
virsh_migrate_extra = "--migrateuri tcp://${migrate_dest_host}:${port_to_check} --listen-address ${migrate_dest_host}"
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${port_to_check} -j DROP"
#firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${port_to_check} -j DROP"
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp --sport ${port_to_check} -j DROP"
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "libvirt_service.kill_service", "func_param": "params"}, {"func": "libvirt_network.setup_firewall_rule", "func_param": "params", "need_sleep_time": "5"}, {"func": "libvirt_network.cleanup_firewall_rule", "func_param": "params", "need_sleep_time": "90"}, {"func": "do_migration", "func_param": "params", "need_sleep_time": "10"}]'
status_error = "no"
Expand Down
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
17 changes: 12 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 @@ -329,11 +330,17 @@ def cleanup_connection(self):

"""
migrate_desturi_port = self.params.get("migrate_desturi_port")
remote_ip = self.params.get("server_ip", self.params.get("remote_ip"))
remote_pwd = self.params.get("server_pwd", self.params.get("remote_pwd"))
remote_user = self.params.get("server_user", self.params.get("remote_user"))

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)
libvirt.remotely_control_libvirtd(remote_ip, remote_user,
remote_pwd, action='restart',
status_error='no')
migration_base.cleanup_conn_obj(self.conn_list, self.test)

def set_remote_log(self):
"""
Expand Down Expand Up @@ -401,8 +408,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