Skip to content

Commit

Permalink
Add one TDX test case by 4 VMs 20 times booting
Browse files Browse the repository at this point in the history
Signed-off-by: Xudong Hao <[email protected]>
  • Loading branch information
xhao22 committed Aug 5, 2024
1 parent e6db42d commit ddcef10
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
6 changes: 6 additions & 0 deletions KVM/qemu/td_boot_multimes.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@
- two_socket:
vcpu_sockets = 2
no one_cpu
- 4vm_20times:
vms = "vm1 vm2 vm3 vm4"
image_snapshot = yes
mem = 16384
iterations = 20
only four_cpu
26 changes: 14 additions & 12 deletions KVM/qemu/tests/td_boot_multimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
def run(test, params, env):
"""
Boot TD by multiple times:
1) Boot up one TDVM
1) Boot up TDVM
2) Shutdown TDVM
3) repeat step1 and step2 multiple times
Expand All @@ -24,17 +24,19 @@ def run(test, params, env):
:param env: Dictionary with test environment
"""

params["start_vm"] = 'yes'
timeout = params.get_numeric("login_timeout", 240)
serial_login = params.get("serial_login", "no") == "yes"
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()
error_context.context("The iteration %s of booting TDVM(s)" % i, test.log.info)
vms = env.get_all_vms()
for vm in vms:
vm.create()
for vm in vms:
vm.verify_alive()
if serial_login:
session = vm.wait_for_serial_login(timeout=timeout)
else:
session = vm.wait_for_login(timeout=timeout)
session.close()
vm.destroy()

0 comments on commit ddcef10

Please sign in to comment.