-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migration: Add case about query domain job info
XXXX - 297944 - VM live migration with copy storage - query domain job info(domjobinfo) Signed-off-by: lcheng <[email protected]>
- Loading branch information
Showing
5 changed files
with
122 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
libvirt/tests/cfg/migration_with_copy_storage/async_job/query_domain_job_info.cfg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
- migration_with_copy_storage.async_job.query_domain_job_info: | ||
type = query_domain_job_info | ||
migration_setup = 'yes' | ||
# Console output can only be monitored via virsh console output | ||
only_pty = True | ||
take_regular_screendumps = no | ||
# Extra options to pass after <domain> <desturi> | ||
virsh_migrate_extra = '' | ||
# SSH connection time out | ||
ssh_timeout = 60 | ||
# Local URI | ||
virsh_migrate_connect_uri = 'qemu:///system' | ||
virsh_migrate_dest_state = "running" | ||
virsh_migrate_src_state = "shut off" | ||
image_convert = 'no' | ||
server_ip = "${migrate_dest_host}" | ||
server_user = "root" | ||
server_pwd = "${migrate_dest_pwd}" | ||
client_ip = "${migrate_source_host}" | ||
client_user = "root" | ||
client_pwd = "${migrate_source_pwd}" | ||
check_network_accessibility_after_mig = "yes" | ||
migrate_desturi_port = "16509" | ||
migrate_desturi_type = "tcp" | ||
virsh_migrate_desturi = "qemu+tcp://${migrate_dest_host}/system" | ||
setup_nfs = "no" | ||
nfs_mount_dir = | ||
status_error = "no" | ||
str_items = {"Job type": "Unbounded", "Operation": "Outgoing migration"} | ||
s_all_items = ["Time elapsed", "Data processed", "Data remaining", "Data total", "File processed", "File remaining", "File total"] | ||
m_all_items = ["Time elapsed", "Data remaining", "Memory processed", "Memory remaining", "Memory total", "Memory bandwidth", "Page size", "Iteration", "File processed", "File total", "Constant pages", "Normal pages", "Normal data", "Expected downtime", "Setup time"] | ||
m_int_items = {"Dirty rate": "0", "Postcopy requests": "0", "File remaining": "0"} | ||
m_sum_items = {"Data processed": "Memory processed+File processed", "Data total": "Memory total+File total"} | ||
dest_items = {"error_msg": "migration statistics are available only on the source host"} | ||
s_domjobinfo = {"src_items": {"str_items": ${str_items}, "all_items": ${s_all_items}}, "dest_items": ${dest_items}} | ||
m_domjobinfo = {"src_items": {"str_items": ${str_items}, "all_items": ${m_all_items}, "int_items": ${m_int_items}, "sum_items": ${m_sum_items}}, "dest_items": ${dest_items}} | ||
action_during_mig = [{"func": "libvirt_monitor.check_domjobinfo_output", "func_param": {"vm_name": "${main_vm}", "expected_domjobinfo": ${s_domjobinfo}, "remote_ip": "${server_ip}"}, "need_sleep_time": "5"}, {"func": "libvirt_monitor.check_domjobinfo_output", "after_event": "migration-iteration", "func_param": {"vm_name": "${main_vm}", "expected_domjobinfo": ${m_domjobinfo}, "remote_ip": "${server_ip}"}, "wait_for_after_event_timeout": 120}] | ||
src_str_items_complete = {"Job type": "Completed", "Operation": "Outgoing migration"} | ||
src_all_items_complete = ["Time elapsed", "Time elapsed w/o network", "Data processed", "Data total", "Memory processed", "Memory total", "Memory bandwidth", "Page size", "Iteration", "File processed", "File total", "Constant pages", "Normal pages", "Normal data", "Total downtime", "Downtime w/o network", "Setup time"] | ||
src_int_items_complete = {"Data remaining": "0", "Memory remaining": "0", "Dirty rate": "0", "Postcopy requests": "0", "File remaining": "0"} | ||
dest_str_items_complete = {"Job type": "Completed", "Operation": "Incoming migration"} | ||
dest_all_items_complete = ["Time elapsed", "Time elapsed w/o network", "Data processed", "Data total", "Memory processed", "Memory total", "Memory bandwidth", "Page size", "Iteration", "Constant pages", "Normal pages", "Normal data", "Total downtime", "Downtime w/o network", "Setup time"] | ||
dest_int_items_complete = {"Data remaining": "0", "Memory remaining": "0", "Dirty rate": "0", "Postcopy requests": "0"} | ||
domjobinfo_complete = {"src_items": {"str_items": ${src_str_items_complete}, "all_items": ${src_all_items_complete}, "int_items": ${src_int_items_complete}}, "dest_items": {"str_items": ${dest_str_items_complete}, "all_items": ${dest_all_items_complete}, "int_items": ${dest_int_items_complete}}} | ||
variants: | ||
- p2p: | ||
virsh_migrate_options = '--live --p2p --verbose' | ||
- non_p2p: | ||
virsh_migrate_options = '--live --verbose' | ||
variants: | ||
- copy_storage_all: | ||
copy_storage_option = "--copy-storage-all" | ||
- copy_storage_inc: | ||
copy_storage_option = "--copy-storage-inc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
libvirt/tests/src/migration_with_copy_storage/async_job/query_domain_job_info.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# | ||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
# | ||
# Copyright Red Hat | ||
# | ||
# SPDX-License-Identifier: GPL-2.0 | ||
|
||
# Author: Liping Cheng<[email protected]> | ||
# | ||
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
from virttest.utils_libvirt import libvirt_monitor | ||
|
||
from provider.migration import base_steps | ||
|
||
|
||
def run(test, params, env): | ||
""" | ||
To verify that domain job info can be queried during and after live | ||
migration with copy storage. | ||
""" | ||
def verify_test(): | ||
""" | ||
Verify test | ||
""" | ||
domjobinfo_complete = eval(params.get("domjobinfo_complete")) | ||
remote_ip = params.get("server_ip") | ||
|
||
test.log.info("Verify test.") | ||
libvirt_monitor.check_domjobinfo_output(vm_name, | ||
expected_domjobinfo_complete=domjobinfo_complete, | ||
options="--completed", | ||
remote_ip=remote_ip) | ||
migration_obj.verify_default() | ||
|
||
vm_name = params.get("migrate_main_vm") | ||
vm = env.get_vm(vm_name) | ||
migration_obj = base_steps.MigrationBase(test, vm, params) | ||
|
||
try: | ||
migration_obj.setup_connection() | ||
base_steps.prepare_disks_remote(params, vm) | ||
migration_obj.run_migration() | ||
verify_test() | ||
finally: | ||
migration_obj.cleanup_connection() | ||
base_steps.cleanup_disks_remote(params, vm) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters