-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check whether the status of edk2 The boot process is normal. Signed-off-by: zhenyzha <[email protected]>
- Loading branch information
Showing
2 changed files
with
71 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,32 @@ | ||
- edk2_basic: | ||
virt_test_type = qemu | ||
only Linux | ||
only x86_64, aarch64 | ||
type = edk2_basic | ||
start_vm = no | ||
login_timeout = 240 | ||
reboot_count = 5 | ||
check_messgae = "enter to boot the selected OS" | ||
skip_image_processing = yes | ||
line_numbers = 40 | ||
variants: | ||
- @default: | ||
- iommu_test: | ||
virtio_dev_iommu_platform = on | ||
virtio_dev_filter = '^(?:(?:virtio-)|(?:vhost-))(?!(?:balloon)|(?:user)|(?:iommu))' | ||
variants: | ||
- intel_iommu: | ||
only q35 | ||
only HostCpuVendor.intel | ||
machine_type_extra_params = "kernel-irqchip=split" | ||
virtio_dev_ats = on | ||
virtio_dev_aer = on | ||
intel_iommu = yes | ||
enable_guest_iommu = yes | ||
- smmuv3: | ||
only aarch64 | ||
machine_type_extra_params += ",iommu=smmuv3" | ||
- viommu: | ||
no Host_RHEL.m9.u0 | ||
required_qemu= [7.0.0,) | ||
virtio_iommu = yes |
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,39 @@ | ||
import time | ||
|
||
from virttest import error_context | ||
|
||
|
||
@error_context.context_aware | ||
def run(test, params, env): | ||
""" | ||
Qemu edk2 basic test: | ||
1) Try to log into a guest | ||
2) Check serial log information | ||
3) Check edk2 output information | ||
4) Add iommu test scenario | ||
5) Cycle the above process | ||
:param test: QEMU test object | ||
:param params: Dictionary with the test parameters | ||
:param env: Dictionary with test environment. | ||
""" | ||
timeout = params.get_numeric("login_timeout", 240) | ||
line_numbers = params.get_numeric("line_numbers", 40) | ||
check_messgae = params.get("check_messgae") | ||
vm = env.get_vm(params["main_vm"]) | ||
|
||
for i in range(params.get_numeric("reboot_count", 1)): | ||
vm.create() | ||
error_context.context("Check serial log result", test.log.info) | ||
try: | ||
output = vm.serial_console.read_until_output_matches([check_messgae], | ||
timeout=timeout) | ||
except Exception as msg: | ||
test.log.error(msg) | ||
test.fail("No highlighted entry was detected " | ||
"the boot was abnormal.") | ||
error_context.context("Check edk2 output information", test.log.info) | ||
if len(output[1].splitlines()) > line_numbers: | ||
test.fail("Warning edk2 line count exceeds %d." % line_numbers) | ||
time.sleep(2) | ||
vm.destroy(gracefully=False) |