From e10466cbeb8513354b8f662c00a77dd12ffd49b0 Mon Sep 17 00:00:00 2001 From: Xudong Hao Date: Wed, 25 Sep 2024 09:44:40 +0800 Subject: [PATCH] KVM: Update the TDX basic test case Check host environment firstly, then try to boot TD. Signed-off-by: Xudong Hao --- KVM/qemu/tdx_basic.cfg | 3 +-- KVM/qemu/tests/tdx_basic.py | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/KVM/qemu/tdx_basic.cfg b/KVM/qemu/tdx_basic.cfg index 7e122e5..df267f0 100644 --- a/KVM/qemu/tdx_basic.cfg +++ b/KVM/qemu/tdx_basic.cfg @@ -7,8 +7,7 @@ # Don't create/remove guest images force_create_image = no remove_image = no - # Automatically start VM - start_vm = yes + start_vm = no # Stop VM after testing kill_vm = yes shell_prompt = "^\[.*\][\#\$]\s*$" diff --git a/KVM/qemu/tests/tdx_basic.py b/KVM/qemu/tests/tdx_basic.py index f896123..6dbd702 100644 --- a/KVM/qemu/tests/tdx_basic.py +++ b/KVM/qemu/tests/tdx_basic.py @@ -8,7 +8,7 @@ # History: May. 2024 - Xudong Hao - creation from avocado.utils import process, cpu -from virttest import error_context +from virttest import error_context, env_process from provider.cpu_utils import check_cpu_flags @@ -41,6 +41,8 @@ def run(test, params, env): if tdx_value != "Y": test.fail("TDX is not supported in KVM") + params["start_vm"] = "yes" + env_process.preprocess_vm(test, params, env, params["main_vm"]) vm = env.get_vm(params["main_vm"]) vm.verify_alive() timeout = params.get_numeric("login_timeout", 240)