diff --git a/libvirt/tests/cfg/memory/memory_allocation/memory_invalid_value.cfg b/libvirt/tests/cfg/memory/memory_allocation/memory_invalid_value.cfg index bb6855b28b0..bbbe6e60d29 100644 --- a/libvirt/tests/cfg/memory/memory_allocation/memory_invalid_value.cfg +++ b/libvirt/tests/cfg/memory/memory_allocation/memory_invalid_value.cfg @@ -9,7 +9,6 @@ max_mem_unit = 'KiB' numa_mem = 1048576 start_vm = no - func_supported_since_libvirt_ver = (9, 0, 0) variants num: - zero: value = 0 @@ -34,6 +33,9 @@ status_error = "yes" - numa: no s390-virtio + zero: + func_supported_since_libvirt_ver = (9, 0, 0) + func_not_supported_since_libvirt_ver = (11, 8, 0) xpaths_list = [{'element_attrs':[".//cell[@id='0']"]}, {'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" diff --git a/libvirt/tests/src/memory/memory_allocation/memory_invalid_value.py b/libvirt/tests/src/memory/memory_allocation/memory_invalid_value.py index 8139f6cfc37..c2042930ee9 100644 --- a/libvirt/tests/src/memory/memory_allocation/memory_invalid_value.py +++ b/libvirt/tests/src/memory/memory_allocation/memory_invalid_value.py @@ -69,6 +69,7 @@ def check_mem_config(): error_msg_2 = params.get("error_msg_2", "") minus_error_msg = params.get("minus_error_msg", "") start_error_msg = params.get("start_error_msg", "") + func_not_supported_since_libvirt_ver = eval(params.get("func_not_supported_since_libvirt_ver", "()")) num = params.get("num") mem_config = params.get("mem_config") @@ -77,8 +78,10 @@ def check_mem_config(): start_vm_error = "yes" == params.get("start_vm_error", "no") try: - if num == "zero" and mem_config == "numa": - libvirt_version.is_libvirt_feature_supported(params) + libvirt_version.is_libvirt_feature_supported(params) + if func_not_supported_since_libvirt_ver: + if libvirt_version.version_compare(*func_not_supported_since_libvirt_ver): + test.cancel("Test is not supported since libvirt version:%s" % str(func_not_supported_since_libvirt_ver)) setup_test() run_test()