-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add 3 TDX cases by booting TD several times
td_boot_multimes.one_socket.one_cpu td_boot_multimes.one_socket.four_cpu td_boot_multimes.two_socket.four_cpu Signed-off-by: Xudong Hao <[email protected]>
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
- td_boot_multimes: | ||
virt_test_type = qemu | ||
type = td_boot_multimes | ||
vm_accelerator = kvm | ||
machine_type_extra_params = "kernel-irqchip=split" | ||
vm_secure_guest_type = tdx | ||
start_vm = no | ||
vga = std | ||
auto_cpu_model = "no" | ||
cpu_model = host | ||
iterations = 10 | ||
variants: | ||
- one_cpu: | ||
smp = 1 | ||
vcpu_maxcpus = 1 | ||
- four_cpu: | ||
smp = 4 | ||
vcpu_maxcpus = 4 | ||
variants: | ||
- one_socket: | ||
vcpu_sockets = 1 | ||
- two_socket: | ||
vcpu_sockets = 2 | ||
no one_cpu |
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,40 @@ | ||
#!/usr/bin/python3 | ||
|
||
# SPDX-License-Identifier: GPL-2.0-only | ||
# Copyright (c) 2024 Intel Corporation | ||
|
||
# Author: Xudong Hao <[email protected]> | ||
# | ||
# History: Jun. 2024 - Xudong Hao - creation | ||
from virttest import env_process | ||
from virttest import error_context | ||
|
||
|
||
# This decorator makes the test function aware of context strings | ||
@error_context.context_aware | ||
def run(test, params, env): | ||
""" | ||
Boot TD by multiple times: | ||
1) Boot up one TDVM | ||
2) Shutdown TDVM | ||
3) repeat step1 and step2 multiple times | ||
:param test: QEMU test object | ||
:param params: Dictionary with the test parameters | ||
:param env: Dictionary with test environment | ||
""" | ||
|
||
params["start_vm"] = 'yes' | ||
timeout = params.get_numeric("login_timeout", 240) | ||
iterations = params.get_numeric("iterations") | ||
for i in range(iterations): | ||
error_context.context("The iteration %s of booting TDVM" % i, test.log.info) | ||
vm_name = params['main_vm'] | ||
try: | ||
env_process.preprocess_vm(test, params, env, vm_name) | ||
except: | ||
raise | ||
vm = env.get_vm(vm_name) | ||
vm.verify_alive() | ||
session = vm.wait_for_login(timeout=timeout) | ||
vm.destroy() |