Skip to content

Commit

Permalink
Merge pull request #4187 from mcasquer/2991_block_iommu_reboot
Browse files Browse the repository at this point in the history
block_with_iommu: expands the test case functionality
  • Loading branch information
zhencliu authored Nov 13, 2024
2 parents 1f08acc + 6180958 commit a806781
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 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,10 @@ 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)

session = vm.reboot(session, 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 a806781

Please sign in to comment.