From 2e373358a106c0fadb506766060e479cd649f5b1 Mon Sep 17 00:00:00 2001 From: mcasquer Date: Tue, 29 Oct 2024 13:44:48 +0100 Subject: [PATCH] block_with_iommu: expands the test case functionality Expands the test case functionality, doing a simple i/o operation after checking the guest has boot up successfully and finally reboot the VM in all the cases. Signed-off-by: mcasquer --- qemu/tests/block_with_iommu.py | 10 ++++++++-- qemu/tests/cfg/block_with_iommu.cfg | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/qemu/tests/block_with_iommu.py b/qemu/tests/block_with_iommu.py index 6e0ff58c35..e955750223 100644 --- a/qemu/tests/block_with_iommu.py +++ b/qemu/tests/block_with_iommu.py @@ -12,7 +12,8 @@ def run(test, params, env): 1. Add "intel_iommu=on" to kernel line of q35 guest. 2. Boot a guest with virtio-scsi with iommu_platform=on. 3. Verify IOMMU enabled in the guest. - 4. Reload kernel then reboot guest. + 4. Execute a simple I/O in the disk + 5. Reload kernel then reboot guest. :param test: QEMU test object. :param params: Dictionary with the test parameters. @@ -60,6 +61,11 @@ def verify_iommu_enabled(): session = vm.wait_for_login(timeout=360) verify_iommu_enabled() + session.cmd(params.get("dd_cmd")) + if params.get("reload_kernel_cmd"): reload_kernel(session) - vm.reboot(session) + + vm.reboot(session) + vm.wait_for_login(timeout=360) + session.cmd(params.get("dd_cmd")) diff --git a/qemu/tests/cfg/block_with_iommu.cfg b/qemu/tests/cfg/block_with_iommu.cfg index 92cc2fc707..279a2d5d1a 100644 --- a/qemu/tests/cfg/block_with_iommu.cfg +++ b/qemu/tests/cfg/block_with_iommu.cfg @@ -18,6 +18,7 @@ virtio_dev_disable_modern = off check_key_words = "DMAR: IOMMU enabled;" check_key_words += "DMAR: Intel(R) Virtualization Technology for Directed I/O" + dd_cmd = "dd if=/dev/urandom of=/home/dd_test oflag=direct bs=1M count=10" variants: - @default: - reload_kernel: