Skip to content

Commit

Permalink
Merge branch 'master' into migrate_with_external_vtpm
Browse files Browse the repository at this point in the history
  • Loading branch information
yanqzhan authored Jun 7, 2023
2 parents 1efec47 + 7c1c7b6 commit 1ef9de1
Show file tree
Hide file tree
Showing 76 changed files with 4,758 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
- chardev.data_transfer:
type = data_transfer
port = "0"
speed = "115200"
device = "ttyS${port}"
audit_log = "ausearch --start today -m VIRT_RESOURCE -i "
audit_log_msg = "['chardev','old-chardev','new-chardev=%s']"
boot_prompt = '["^Red Hat Enterprise Linux \S+ \S+ \S+","Kernel [0-9]\S+. [a-z]+ \S+ \S+","localhost login:"]'
host_msg = "host_msg"
guest_msg = "guest_msg"
variants:
- file:
chardev_type = "file"
file_path = "/var/log/libvirt/qemu/testfile"
host_cmd = "tail -f %s | grep ${guest_msg} "
- pipe:
chardev_type = "pipe"
pipe_path = "/tmp/mypipe"
pipe_in = "${pipe_path}.in"
pipe_out = "${pipe_path}.out"
host_cmd = "cat < %s "
variants:
- console:
chardev = "console"
variants:
- virtio_target:
target_type = "virtio"
device = "hvc0"
target_path = "/dev/hvc"
device_dict = "{'type_name':'${chardev_type}','sources': [{'attrs': {'path': '%s'}}],'target_type':'%s', 'alias': {'name': '%s'},'target_port':'${port}'}"
- serial_target:
target_type = "serial"
target_path = "/dev/ttyS"
device_dict = "{'type_name':'${chardev_type}','sources': [{'attrs': {'path': '%s'}}],'target_type':'%s', 'alias': {'name': '%s'},'target_port':'${port}'}"
- serial:
chardev = "serial"
target_path = "/dev/ttyS"
variants:
- pci_target:
target_type = "pci-serial"
target_model = "pci-serial"
device_dict = "{'type_name':'${chardev_type}','sources': [{'attrs': {'path': '%s'}}],'target_type':'%s', 'target_model':'${target_model}','target_port':'${port}','alias': {'name': '%s'}}"
- isa_target:
target_type = "isa-serial"
target_model = "isa-serial"
device_dict = "{'type_name':'${chardev_type}','sources': [{'attrs': {'path': '%s'}}],'target_type':'%s', 'target_model':'${target_model}','target_port':'${port}','alias': {'name': '%s'}}"
- channel:
chardev = "channel"
target_name = "org.chardev.test"
target_path = "/dev/virtio-ports/"
device_dict = "{'type_name':'${chardev_type}','sources': [{'attrs': {'path': '%s'}}],'target':{'type':'%s' ,'name':'${target_name}','state':'connected'}, 'alias': {'name': '%s'}}"
variants:
- virtio_target:
target_type = "virtio"
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
- chardev.file_append:
type = file_append_option
speed = "115200"
device = "ttyS0"
dev_index = 1
boot_prompt = '["Kernel [0-9]\S+. [a-z]+ \S+ \S+","localhost login:"]'
chardev_type = 'file'
file_path = "/var/log/libvirt/qemu/testfile"
variants:
- append_on:
append_value = "on"
device_dict = "{'type_name':'${chardev_type}','sources': [{'attrs': {'path': '${file_path}','append':'${append_value}'}}], 'target_port':'0'}"
- append_off:
append_value = "off"
device_dict = "{'type_name':'${chardev_type}','sources': [{'attrs': {'path': '${file_path}','append':'${append_value}'}}], 'target_port':'0'}"
- append_default:
append_value = "default"
device_dict = "{'type_name':'${chardev_type}','sources': [{'attrs': {'path': '${file_path}'}}], 'target_port':'0'}"
variants:
- serial:
chardev = "serial"

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
- conf_file.libvirtd_conf.processing_controls:
type = processing_controls
func_supported_since_libvirt_ver = (9, 0, 0)
start_vm = no
variants:
- positive_test:
Expand Down
68 changes: 68 additions & 0 deletions libvirt/tests/cfg/domain_life_cycle/create_destroy_domain.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
- domain_life_cycle:
type = create_destroy_domain
status_error = "no"
start_vm = "no"
variants test_operation:
- create_domain:
variants:
- negative:
variants test_scenario:
- same_name_with_existed_guest:
error_msg = "already exists with uuid"
- 248_characters_name:
dom_new_name = "11111111"
error_msg = "File name too long"
- not_existed_network:
dom_new_name = "not_existed_network_domain"
dom_new_network = "defaultno"
error_msg = "Network not found"
- overwritten_domain_xml:
dom_new_name = "overwritten_domain_name"
error_msg = "already exists with uuid"
- define_domain:
variants:
- positive:
variants test_scenario:
- not_existed_network:
dom_new_name = "not_existed_network"
- negative:
variants test_scenario:
- 248_characters_name:
dom_new_name = "11111111"
error_msg = "File name too long"
- undefine_domain:
variants:
- positive:
variants test_scenario:
- wipe_storage:
target_device = "vdb"
source_file_path = "/var/lib/libvirt/images/wipe_storage.qcow2"
- convert_persistent_to_transient:
- reset_domain:
variants:
- negative:
variants test_scenario:
- shut_off_state_guest:
dom_new_name = "reset_domain_name"
error_msg = "domain is not running"
- start_domain:
variants:
- negative:
variants test_scenario:
- memory_bigger_than_allocated:
status_error = "yes"
memory_factor = "4"
error_msg = "Cannot allocate memory"
- destroy_domain:
variants:
- positive:
variants test_scenario:
- paused_state_guest:
dom_new_name = "paused_guest"
fake_disk = "yes"
- shutdown_domain:
variants:
- negative:
variants test_scenario:
- paused_state_guest:
error_msg = "domain is not running"
5 changes: 5 additions & 0 deletions libvirt/tests/cfg/host_hypervisor/capabilities_output.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- capabilities.output:
type = capabilities_output
start_vm = no
variants test_case:
- machine_types:
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
- memory.allocation.invalid_value:
type = memory_invalid_value
mem_value = 2097152
mem_unit = 'KiB'
current_mem = 2097152
current_mem_unit = 'KiB'
max_mem_slots = 16
max_mem = 15242880
max_mem_unit = 'KiB'
numa_mem = 1048576
start_vm = no
variants num:
- zero:
value = 0
- minus:
value = -1
status_error = "yes"
minus_error_msg = "Invalid value '${value}' for element or attribute "
variants mem_config:
- memory:
vm_attrs = {'memory':${value},'memory_unit':'${mem_unit}','current_mem':${current_mem},'current_mem_unit':"${current_mem_unit}"}
error_msg = "Memory size must be specified via <memory> or in the <numa> configuration"
status_error = "yes"
- current_memory:
start_vm_error = "no"
status_error = "no"
xpaths_list = [{'element_attrs':[".//currentMemory[@unit='${current_mem_unit}']"],'text':'${current_mem}'}]
vm_attrs = {'current_mem':${value},'current_mem_unit':"${current_mem_unit}",'memory':${mem_value},'memory_unit':'${mem_unit}'}
- mam_memory:
vm_attrs = {'max_mem_rt': ${value}, 'max_mem_rt_slots': ${max_mem_slots}, 'max_mem_rt_unit': "${max_mem_unit}",'memory_unit':"${mem_unit}",'memory':${mem_value},'current_mem':${current_mem},'current_mem_unit':'${current_mem_unit}','vcpu': 4,'cpu': {'numa_cell': [{'id': '0', 'cpus': '0-1', 'memory': '${numa_mem}', 'unit': 'KiB'},{'id':'1','cpus': '2-3','memory':'${numa_mem}','unit':'KiB'}]}}
error_msg = "both maximum memory size and memory slot count must be specified"
status_error = "yes"
- numa:
xpaths_list = [{'element_attrs':[".//cell[@id='0']"], 'text':'${value}'}, {'element_attrs':[".//memory[@unit='${mem_unit}']"], 'text':'${numa_mem}'}, {'element_attrs':[".//currentMemory[@unit='${current_mem_unit}']"], 'text':'${numa_mem}'}]
vm_attrs = {'max_mem_rt': ${max_mem}, 'max_mem_rt_slots': ${max_mem_slots}, 'max_mem_rt_unit': "${max_mem_unit}",'memory_unit':"${mem_unit}",'memory':${mem_value},'current_mem':${current_mem},'current_mem_unit':'${current_mem_unit}','vcpu': 4,'cpu': {'numa_cell': [{'id': '0', 'cpus': '0-1', 'memory': '${value}', 'unit': 'KiB'},{'id':'1','cpus': '2-3','memory':'${numa_mem}','unit':'KiB'}]}}
start_vm_error = "yes"
status_error = "no"
start_error_msg = "property 'size' of memory-backend-ram doesn't take value '${value}'"
- mixed_mem:
xpaths_list = [{'element_attrs':[".//memory[@unit='${mem_unit}']"], 'text':'${mem_value}'}, {'element_attrs':[".//currentMemory[@unit='${current_mem_unit}']"], 'text':'${current_mem}'}]
vm_attrs = {'memory':${value},'current_mem':${value},'max_mem_rt': ${max_mem}, 'max_mem_rt_slots': ${max_mem_slots}, 'max_mem_rt_unit': "${max_mem_unit}",'memory_unit':"${mem_unit}",'current_mem_unit':'${current_mem_unit}','vcpu': 4,'cpu': {'numa_cell': [{'id': '0', 'cpus': '0-1', 'memory': '${numa_mem}', 'unit': 'KiB'},{'id':'1','cpus': '2-3','memory':'${numa_mem}','unit':'KiB'}]}}
start_vm_error = "no"
status_error = "no"

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
- memory.devices.lifecycle:
type = lifecycle_of_mixed_memory_devices
start_vm = no
numa_mem = 1048576
numa_num = 2
default_unit = "KiB"
vm_attrs = {'max_mem_rt': 52428800, 'max_mem_rt_slots': 16, 'max_mem_rt_unit': 'KiB','vcpu': 4,'cpu': {'numa_cell': [{'id': '0', 'cpus': '0-1', 'memory': '${numa_mem}', 'unit': 'KiB'},{'id':'1','cpus': '2-3','memory':'${numa_mem}','unit':'KiB'}]}}
nvdimm_path_1 = "/tmp/nvdimm1"
nvdimm_path_2 = "/tmp/nvdimm2"
save_file = "/tmp/guest.save"
nr_hugepages = 256
kernel_hp_file = "/proc/sys/vm/nr_hugepages"
truncate_cmd = "truncate -s 512M ${nvdimm_path_1} && truncate -s 512M ${nvdimm_path_2}"
kernel_params_remove = "memhp_default_state"
kernel_params_add = "memhp_default_state=online_movable"
page_size = 2048
dimm_1 = [262144, 262144, 1, "", 1, "dimm_dict_1"]
nvdimm_1 = [524288, 0, 2, "", "", "nvdimm_dict_1"]
virtio_mem_1 = [2097152, 1048576, 3, "", "", "virtio_mem_dict_1"]
dimm_2 = [262144, 262144,"", 1, "", "dimm_dict_2"]
nvdimm_2 = [524288, 0, "", 2, "", "nvdimm_dict_2"]
virtio_mem_2 = [262144, 262144, "", 3, "","virtio_mem_dict_2"]
set_items = ["memory_affected", "current_mem_affected","init_seq","hotplug_seq","hotunplug_seq", "dev_dict"]
set_value = [${dimm_1}, ${nvdimm_1}, ${virtio_mem_1}, ${dimm_2}, ${nvdimm_2}, ${virtio_mem_2}]
dimm_target_dize = 262144
nvdimm_target_dize = 524288
virtio_mem_target_size = 2097152
dimm_dict_1 = {'mem_model': 'dimm', 'mem_access':'private','mem_discard':'no','source': {"pagesize":${page_size}, "pagesize_unit":"KiB"},'target': {'size': ${dimm_target_dize}, 'size_unit': 'KiB','node':0}}
nvdimm_dict_1 = {'mem_model': 'nvdimm', 'source': {"path":"${nvdimm_path_1}"}, 'target': {'size': ${nvdimm_target_dize}, 'size_unit': 'KiB','node':1 }}
virtio_mem_dict_1 = {'mem_model': 'virtio-mem', 'target': {'size': ${virtio_mem_target_size}, 'size_unit': 'KiB','node':0, 'block_unit':'KiB','block_size':2048,'requested_size':1048576, 'requested_unit':'KiB'}}
variants:
- mutiple_mem:
dimm_dict_2 = {'mem_model': 'dimm', 'mem_access':'shared','mem_discard':'yes','target': {'size': ${dimm_target_dize}, 'size_unit': 'KiB','node':1}}
nvdimm_dict_2 = {'mem_model': 'nvdimm', 'source': {"path":"${nvdimm_path_2}"}, 'target': {'size': ${nvdimm_target_dize}, 'size_unit': 'KiB','node':1, 'label':{'size':128, 'size_unit':'KiB'} }}
virtio_mem_dict_2 = {'mem_model': 'virtio-mem','source': {"pagesize":${page_size}, "pagesize_unit":"KiB"}, 'target': {'size': 262144, 'size_unit': 'KiB','node':0, 'block_unit':'KiB','block_size':2048,'requested_size':262144, 'requested_unit':'KiB'}}
xpath_basic = {'element_attrs': [".//memory[@unit='${default_unit}']"],'text': '%s'},{'element_attrs': [".//currentMemory[@unit='${default_unit}']"],'text': '%s'},{'element_attrs': [".//alias[@name='dimm0']"]},{'element_attrs': [".//address[@slot='0']",".//address[@type='dimm']"]},{'element_attrs': [".//alias[@name='nvdimm1']"]},{'element_attrs': [".//address[@slot='1']",".//address[@type='dimm']"]},{'element_attrs': [".//alias[@name='virtiomem0']"]}
xpath_after_start = [${xpath_basic}]
xpath_after_attached = [${xpath_basic},{'element_attrs': [".//alias[@name='dimm2']"]},{'element_attrs': [".//address[@slot='2']",".//address[@type='dimm']"]},{'element_attrs': [".//alias[@name='nvdimm3']"]}, {'element_attrs': [".//address[@slot='3']",".//address[@type='dimm']"]},{'element_attrs': [".//alias[@name='virtiomem1']"]}]
xpath_after_detached = [${xpath_basic}, {'element_attrs': [".//alias[@name='dimm2']"]},{'element_attrs': [".//address[@slot='2']",".//address[@type='dimm']"]},{'element_attrs': [".//alias[@name='nvdimm3']"]},{'element_attrs': [".//address[@slot='3']",".//address[@type='dimm']"]},{'element_attrs': [".//alias[@name='virtiomem1']"]}]
del_head = 2
del_tail = 4
6 changes: 3 additions & 3 deletions libvirt/tests/cfg/migration/migrate_options_shared.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@
stress_in_vm = "yes"
stress_args = "--cpu 4 --io 4 --vm 2 --vm-bytes 256M --timeout 70"
actions_during_migration = "killqemutarget"
err_msg = "error: internal error: qemu unexpectedly closed the monitor|error: operation failed: domain is not running|Domain not found"
err_msg = "error: internal error: qemu unexpectedly closed the monitor|error: operation failed: domain is not running|Domain not found|QEMU unexpectedly closed the monitor"
- disable_keepalive:
only without_postcopy
break_network_connection = "yes"
Expand Down Expand Up @@ -607,7 +607,7 @@
variants:
- without_option:
virsh_migrate_extra = "--tls"
err_msg = "error: internal error: qemu unexpectedly closed the monitor|Domain not found"
err_msg = "error: internal error: qemu unexpectedly closed the monitor|Domain not found|QEMU unexpectedly closed the monitor"
- empty_str:
virsh_migrate_extra = "--tls --tls-destination ''"
err_msg = "error: Failed to get option 'tls-destination': Option argument is empty"
Expand All @@ -616,7 +616,7 @@
err_msg = "error: Option --tls is required by option --tls-destination"
- incorrect_hostname:
virsh_migrate_extra = "--tls --tls-destination fake${server_cn}"
err_msg = "error: internal error: qemu unexpectedly closed the monitor|Domain not found"
err_msg = "error: internal error: qemu unexpectedly closed the monitor|Domain not found|QEMU unexpectedly closed the monitor"
- tunnelled_migration:
only without_postcopy
virsh_migrate_options = "--live --p2p --tunnelled --verbose"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
virsh_migrate_extra_mig_again = "--zerocopy --parallel"
- zerocopy_and_parallel_and_compression:
virsh_migrate_extra = "--zerocopy --parallel --compressed --comp-methods mt"
err_msg = "Zero copy only available for non-compressed non-TLS multifd migration|Multifd is not compatible with compress"
err_msg = "Zero copy only available for non-compressed non-TLS multifd migration|Multifd is not compatible with compress|Compression method 'mt' isn't supported with parallel migration"
migrate_again = "yes"
migrate_again_status_error = "no"
virsh_migrate_extra_mig_again = "--zerocopy --parallel"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
- guest_numa_topology.various_numa_topology_settings:
type = various_numa_topology_settings
take_regular_screendumps = no
start_vm = "no"
vcpu = 4
memory_backing = {'hugepages': {}}
qemu_monitor_option = '--hmp'
qemu_monitor_cmd = 'info memdev'
cpu_mode = 'host-model'
target_hugepages = 1024
hugepage_size = 2048
numa_cell_0 = {'id': '0', 'memory': '1048576', 'cpus': '0-1'}
numa_cell_1 = {'id': '1', 'memory': '1048576', 'cpus': '2-3'}
numa_cells = [${numa_cell_0}, ${numa_cell_1}]
variants:
- memaccess_none:
pattern_share_in_qmp_output = 'share:\s*false'
- memaccess_shared:
memAccess = 'shared'
pattern_share_in_qmp_output = 'share:\s*true'
- memaccess_private:
memAccess = 'private'
pattern_share_in_qmp_output = 'share:\s*false'
- memaccess_invalid:
memAccess = 'invalid'
status_error = yes
err_msg = "Invalid value for attribute '%s' in element 'cell': 'invalid'"
variants:
- discard_none:
- discard_yes:
discard = 'yes'
pattern_in_qemu_cmdline = '"?discard-data"?(=|:)(yes|true|on)'
- discard_no:
discard = 'no'
pattern_in_qemu_cmdline = '"?discard-data"?(=|:)(no|false|off)'
- discard_invalid:
discard = 'invalid'
status_error = 'yes'
err_msg = "Invalid value for attribute '%s' in element 'cell': 'invalid'"
14 changes: 14 additions & 0 deletions libvirt/tests/cfg/save_and_restore/save_with_formats.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- save_and_restore.save_with_formats:
type = save_with_formats
start_vm = no
libvirtd_debug_level = 1
libvirtd_debug_file = /var/log/libvirt/virtqemud.log
variants:
- positive_test:
status_error = no
save_formats = raw lzop gzip bzip2 xz
- negative_test:
status_error = yes
variants save_format:
- abc:
error_msg = Invalid save image format specified in configuration file
Loading

0 comments on commit 1ef9de1

Please sign in to comment.