diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c18dd8d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__/ diff --git a/KVM/qemu/boot_check.cfg b/KVM/qemu/boot_check.cfg index 2a3597e..b14d9eb 100644 --- a/KVM/qemu/boot_check.cfg +++ b/KVM/qemu/boot_check.cfg @@ -32,11 +32,16 @@ variants: - 1G: no 208_cpu, 256_cpu, 288_cpu + is_max_mem = no mem = 1024 - 4G: + is_max_mem = no mem = 4096 - 16G: + is_max_mem = no mem = 16384 + - max_mem: + is_max_mem = yes variants: - vm: - tdvm: diff --git a/KVM/qemu/tests/boot_check.py b/KVM/qemu/tests/boot_check.py index 15a64ed..1c5e415 100644 --- a/KVM/qemu/tests/boot_check.py +++ b/KVM/qemu/tests/boot_check.py @@ -7,9 +7,12 @@ # # History: July. 2024 - Xudong Hao - creation +import subprocess + from avocado.utils import cpu from virttest import env_process from virttest import error_context +from virttest import utils_misc @error_context.context_aware @@ -41,7 +44,11 @@ def run(test, params, env): vcpus = params.get_numeric("smp") if vm.get_cpu_count() != vcpus: test.fail("CPU number in guest is not same as configured vcpus number") - memory = params.get_numeric("mem") - if vm.get_totalmem_sys()//1024 != memory: - test.fail("Memory in guest is not same as configured") + is_max_mem = params.get_boolean("is_max_mem") + if is_max_mem: + memory = utils_misc.get_usable_memory_size() + else: + memory = params.get_numeric("mem") + if vm.get_totalmem_sys()//1024 != memory: + test.fail("Memory in guest is not same as configured") session.close()