-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test cases to check maximum vCPUs with SE guest
Secure_execution: add test cases for both positive and negative to check if SE guest could get 247 for maximum vCPU and the error message is expected when it get 248 vCPUs Signed-off-by: Boqiao Fu <[email protected]>
- Loading branch information
Showing
2 changed files
with
66 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,28 @@ | ||
- secure_execution: secure_img | ||
only s390x | ||
virt_test_type = qemu | ||
type = secure_execution | ||
take_regular_screendumps = no | ||
start_vm = no | ||
kill_vm_before_test = yes | ||
kill_vm = yes | ||
machine_type_extra_params = "usb=off,dump-guest-core=off,confidential-guest-support=lsec0" | ||
extra_params = "-object s390-pv-guest,id=lsec0" | ||
nic_extra_params = "devno=fe.0.0001" | ||
virtio_serial_extra_params = "devno=fe.0.0002" | ||
variants: | ||
- 247_max_vCPUs: | ||
smp = 247 | ||
vcpu_maxcpus = 247 | ||
vcpu_sockets = 13 | ||
vcpu_cores = 19 | ||
vcpu_threads = 1 | ||
- 248_vCPUs_error_check: | ||
error_check = "yes" | ||
smp = 248 | ||
vcpu_maxcpus = 248 | ||
RHEL.8: | ||
required_qemu = [6.2.0-33,) | ||
RHEL.9: | ||
required_qemu = [7.2.0-6,) | ||
error_msg = "qemu-kvm: Protected VMs support a maximum of 247 CPUs" |
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,38 @@ | ||
from virttest import error_context | ||
from virttest import virt_vm | ||
|
||
|
||
@error_context.context_aware | ||
def run(test, params, env): | ||
""" | ||
Secured guest boot test: | ||
1) Log into a secure guest | ||
2) Check if there's error messagein | ||
:param test: QEMU test object | ||
:param params: Dictionary with the test parameters | ||
:param env: Dictionary with test environment. | ||
""" | ||
|
||
vm = env.get_vm(params["main_vm"]) | ||
error_context.context("Try to log into guest '%s'." % vm.name, | ||
test.log.info) | ||
if params.get("start_vm") == "no" and not params.get_boolean("error_check"): | ||
vm.create(params=params) | ||
vm.verify_alive() | ||
session = vm.wait_for_serial_login() | ||
session.close() | ||
vm.destroy() | ||
else: | ||
error_msg = params.get("error_msg", "") | ||
try: | ||
vm.create(params=params) | ||
vm.verify_alive() | ||
output = vm.process.get_output() | ||
vm.destroy() | ||
except virt_vm.VMCreateError as detail: | ||
output = str(detail) | ||
if error_msg not in output: | ||
test.fail("Error message is not expected! " | ||
"Expected: {} Actual: {}" | ||
.format(error_msg, output)) |