Skip to content

Commit

Permalink
block_with_iommu: expands the test case functionality
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
mcasquer committed Nov 4, 2024
1 parent 9a57983 commit 2e37335
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
10 changes: 8 additions & 2 deletions qemu/tests/block_with_iommu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"))
1 change: 1 addition & 0 deletions qemu/tests/cfg/block_with_iommu.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2e37335

Please sign in to comment.