Skip to content

Commit d93bbed

Browse files
committed
migration: Update cases about tcp connections
Update tcp configurations parameters to make tcp connections timeout more quickly. Signed-off-by: lcheng <[email protected]>
1 parent 80e95e8 commit d93bbed

File tree

8 files changed

+24
-16
lines changed

8 files changed

+24
-16
lines changed

libvirt/tests/cfg/migration/pause_postcopy_migration_and_recover/pause_and_recover_and_disruptive.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@
7777
virsh_migrate_extra = "--migrateuri tcp://${migrate_dest_host}:${port_to_check} --listen-address ${migrate_dest_host}"
7878
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${port_to_check} -j DROP"
7979
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp --sport ${port_to_check} -j DROP"
80-
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"}]'
80+
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": "10"}]'
8181
status_error_during_mig = "no"
82-
tcp_config_list = '{"tcp_keepalive_probes": "9", "tcp_keepalive_intvl": "60", "tcp_retries1": "4", "tcp_retries2": "8", "tcp_fin_timeout": "2"}'
82+
tcp_config_list = '{"tcp_keepalive_probes": "3", "tcp_keepalive_intvl": "3", "tcp_retries1": "1", "tcp_retries2": "1", "tcp_fin_timeout": "2"}'
8383
recover_tcp_config_list = '{"tcp_keepalive_probes": "9", "tcp_keepalive_intvl": "75", "tcp_retries1": "3", "tcp_retries2": "15", "tcp_fin_timeout": "60"}'
8484
- pause_by_proxy_issue:
8585
action_during_do_mig = '[{"func": "clear_pmsocat", "func_param": "params", "need_sleep_time": "5"}, {"func": "base_steps.recreate_conn_objs", "func_param": "params", "need_sleep_time": "10"}]'

libvirt/tests/cfg/migration/pause_postcopy_migration_and_recover/pause_and_recover_twice.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@
4646
virsh_migrate_extra = "--migrateuri tcp://${migrate_dest_host}:${port_to_check} --listen-address ${migrate_dest_host}"
4747
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${port_to_check} -j DROP"
4848
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp --sport ${port_to_check} -j DROP"
49-
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"}]'
49+
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": "15"}, {"func": "libvirt_network.cleanup_firewall_rule", "func_param": "params", "need_sleep_time": "5"}, {"func": "resume_migration_again", "func_param": "params", "need_sleep_time": "5"}]'
5050
migrate_desturi_port = "16509"
5151
migrate_desturi_type = "tcp"
5252
virsh_migrate_desturi = "qemu+tcp://${migrate_dest_host}/system"
5353
err_msg_during_mig = "unable to connect to server at.*: Connection timed out"
54-
tcp_config_list = '{"tcp_keepalive_probes": "9", "tcp_keepalive_intvl": "60", "tcp_retries1": "4", "tcp_retries2": "8", "tcp_fin_timeout": "2"}'
54+
tcp_config_list = '{"tcp_keepalive_probes": "3", "tcp_keepalive_intvl": "3", "tcp_retries1": "1", "tcp_retries2": "1", "tcp_fin_timeout": "2"}'
5555
recover_tcp_config_list = '{"tcp_keepalive_probes": "9", "tcp_keepalive_intvl": "75", "tcp_retries1": "3", "tcp_retries2": "15", "tcp_fin_timeout": "60"}'
5656
- proxy_issue:
5757
transport_type = "unix_proxy"

libvirt/tests/cfg/migration/pause_postcopy_migration_and_recover/unattended_migration.cfg

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@
6767
expected_event_src = ["event 'lifecycle' for domain .*: Suspended Post-copy"]
6868
expected_event_src_2 = ["event 'lifecycle' for domain .*: Stopped Migrated", "event 'job-completed' for domain"]
6969
expected_event_target = ["event 'lifecycle' for domain.*: Resumed Post-copy", "event 'lifecycle' for domain.*: Resumed Migrated"]
70-
tcp_config_list = '{"tcp_keepalive_probes": "9", "tcp_keepalive_intvl": "60", "tcp_retries1": "4", "tcp_retries2": "8", "tcp_fin_timeout": "2"}'
70+
tcp_config_list = '{"tcp_keepalive_probes": "3", "tcp_keepalive_intvl": "3", "tcp_retries1": "1", "tcp_retries2": "1", "tcp_fin_timeout": "2"}'
7171
recover_tcp_config_list = '{"tcp_keepalive_probes": "9", "tcp_keepalive_intvl": "75", "tcp_retries1": "3", "tcp_retries2": "15", "tcp_fin_timeout": "60"}'
7272
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "check_event_before_unattended", "func_param": "params"}, {"func": "libvirt_network.setup_firewall_rule", "func_param": "params"}, {"func": "do_common_check", "func_param": "params", "need_sleep_time": "90"}, {"func": "wait_for_unattended_mig", "func_param": "params"}, {"func": "libvirt_network.cleanup_firewall_rule", "func_param": "params"}]'
73+
action_during_mig = '[{"func": "libvirt_network.check_established", "after_event": "iteration: '1'", "func_param": 'params'}, {"func": "check_event_before_unattended", "func_param": "params"}, {"func": "libvirt_network.setup_firewall_rule", "func_param": "params"}, {"func": "do_common_check", "func_param": "params", "need_sleep_time": "15"}, {"func": "wait_for_unattended_mig", "func_param": "params"}]'
7374
variants migration_options:
7475
- with_undefinesource_persistent:
7576
virsh_migrate_extra = "--undefinesource --persistent"

libvirt/tests/cfg/migration/pause_postcopy_migration_and_recover/unattended_migration_and_disruptive.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@
6464
virsh_migrate_extra = "--migrateuri tcp://${migrate_dest_host}:${port_to_check} --listen-address ${migrate_dest_host}"
6565
firewall_rule_on_dest = "ipv4 filter INPUT 0 -p tcp --dport ${port_to_check} -j DROP"
6666
firewall_rule_on_src = "ipv4 filter INPUT 0 -p tcp --sport ${port_to_check} -j DROP"
67-
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"}]'
67+
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": "10"}, {"func": "do_migration", "func_param": "params", "need_sleep_time": "10"}]'
6868
status_error = "no"
6969
status_error_during_mig = "no"
70-
tcp_config_list = '{"tcp_keepalive_probes": "9", "tcp_keepalive_intvl": "60", "tcp_retries1": "4", "tcp_retries2": "8", "tcp_fin_timeout": "2"}'
70+
tcp_config_list = '{"tcp_keepalive_probes": "3", "tcp_keepalive_intvl": "3", "tcp_retries1": "1", "tcp_retries2": "1", "tcp_fin_timeout": "2"}'
7171
recover_tcp_config_list = '{"tcp_keepalive_probes": "9", "tcp_keepalive_intvl": "75", "tcp_retries1": "3", "tcp_retries2": "15", "tcp_fin_timeout": "60"}'
7272
action_during_do_mig = '[{"func": "set_migrate_speed_to_high", "before_pause": "yes", "func_param": "params"}]'
7373
- pause_by_proxy:

libvirt/tests/src/migration/pause_postcopy_migration_and_recover/pause_and_recover_and_disruptive.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def setup_pause_by_network():
2121
"""
2222
test.log.info("Setup for pause_by_network")
2323
tcp_config_list = eval(params.get("tcp_config_list"))
24-
libvirt_network.change_tcp_config(tcp_config_list)
24+
libvirt_network.change_tcp_config(tcp_config_list, params)
2525
migration_obj.setup_connection()
2626

2727
def cleanup_pause_by_network():
@@ -31,7 +31,7 @@ def cleanup_pause_by_network():
3131
"""
3232
test.log.info("Cleanup for pause_by_network")
3333
recover_tcp_config_list = eval(params.get("recover_tcp_config_list"))
34-
libvirt_network.change_tcp_config(recover_tcp_config_list)
34+
libvirt_network.change_tcp_config(recover_tcp_config_list, params)
3535
migration_obj.cleanup_connection()
3636

3737
libvirt_version.is_libvirt_feature_supported(params)

libvirt/tests/src/migration/pause_postcopy_migration_and_recover/pause_and_recover_twice.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def setup_network_issue():
2121
"""
2222
test.log.info("Setup for network issue")
2323
tcp_config_list = eval(params.get("tcp_config_list"))
24-
libvirt_network.change_tcp_config(tcp_config_list)
24+
libvirt_network.change_tcp_config(tcp_config_list, params)
2525
migration_obj.setup_connection()
2626

2727
def cleanup_network_issue():
@@ -31,7 +31,7 @@ def cleanup_network_issue():
3131
"""
3232
test.log.info("Cleanup for network issue")
3333
recover_tcp_config_list = eval(params.get("recover_tcp_config_list"))
34-
libvirt_network.change_tcp_config(recover_tcp_config_list)
34+
libvirt_network.change_tcp_config(recover_tcp_config_list, params)
3535
migration_obj.cleanup_connection()
3636

3737
libvirt_version.is_libvirt_feature_supported(params)

libvirt/tests/src/migration/pause_postcopy_migration_and_recover/unattended_migration.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def setup_network_issue_libvirt_layer():
3939
"""
4040
test.log.info("Setup for network_issue_libvirt_layer.")
4141
tcp_config_list = eval(params.get("tcp_config_list"))
42-
libvirt_network.change_tcp_config(tcp_config_list)
42+
libvirt_network.change_tcp_config(tcp_config_list, params)
4343
migration_obj.setup_connection()
4444

4545
def verify_test():
@@ -51,6 +51,9 @@ def verify_test():
5151
dominfo_check = params.get("dominfo_check")
5252
migration_options = params.get("migration_options")
5353

54+
if make_unattended == "network_issue_libvirt_layer":
55+
libvirt_network.cleanup_firewall_rule(params)
56+
remote_firewall_rule = True
5457
# check domain persistence
5558
if dominfo_check:
5659
dominfo = virsh.dominfo(vm_name, ignore_status=True, debug=True, uri=dest_uri)
@@ -61,7 +64,8 @@ def verify_test():
6164
func_returns = dict(migration_obj.migration_test.func_ret)
6265
migration_obj.migration_test.func_ret.clear()
6366
test.log.debug("Migration returns function results:%s", func_returns)
64-
if not libvirt.check_vm_state(vm_name, virsh_migrate_src_state, uri=migration_obj.src_uri):
67+
if not libvirt.check_vm_state(vm_name, virsh_migrate_src_state,
68+
uri=migration_obj.src_uri, debug=True):
6569
test.fail("Migrated VMs failed to be in %s state at source" % virsh_migrate_src_state)
6670
if int(migration_obj.migration_test.ret.exit_status) == 0:
6771
migration_obj.migration_test.post_migration_check([vm], params,
@@ -76,13 +80,16 @@ def cleanup_network_issue_libvirt_layer():
7680
"""
7781
test.log.info("Cleanup for network_issue_libvirt_layer")
7882
recover_tcp_config_list = eval(params.get("recover_tcp_config_list"))
79-
libvirt_network.change_tcp_config(recover_tcp_config_list)
83+
if not remote_firewall_rule:
84+
libvirt_network.cleanup_firewall_rule(params)
85+
libvirt_network.change_tcp_config(recover_tcp_config_list, params)
8086
migration_obj.cleanup_connection()
8187

8288
libvirt_version.is_libvirt_feature_supported(params)
8389

8490
vm_name = params.get("migrate_main_vm")
8591
make_unattended = params.get("make_unattended")
92+
remote_firewall_rule = False
8693

8794
virsh_session = None
8895
remote_virsh_session = None

libvirt/tests/src/migration/pause_postcopy_migration_and_recover/unattended_migration_and_disruptive.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def setup_pause_by_network():
2222
"""
2323
test.log.info("Setup for pause_by_network.")
2424
tcp_config_list = eval(params.get("tcp_config_list"))
25-
libvirt_network.change_tcp_config(tcp_config_list)
25+
libvirt_network.change_tcp_config(tcp_config_list, params)
2626
migration_obj.setup_connection()
2727

2828
def cleanup_pause_by_network():
@@ -32,7 +32,7 @@ def cleanup_pause_by_network():
3232
"""
3333
test.log.info("Cleanup for pause_by_network")
3434
recover_tcp_config_list = eval(params.get("recover_tcp_config_list"))
35-
libvirt_network.change_tcp_config(recover_tcp_config_list)
35+
libvirt_network.change_tcp_config(recover_tcp_config_list, params)
3636
migration_obj.cleanup_connection()
3737

3838
libvirt_version.is_libvirt_feature_supported(params)

0 commit comments

Comments
 (0)