-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
block_disk_not_default_options: creates new test case
Creates a new test case that boots up a VM with a disk configured with non-common options such as packed or page-per-vq. Unplug the disk and hotplugs it again. Signed-off-by: Mario Casquero <[email protected]>
- Loading branch information
Showing
2 changed files
with
47 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,30 @@ | ||
from virttest import error_context | ||
|
||
from provider.block_devices_plug import BlockDevicesPlug | ||
|
||
|
||
@error_context.context_aware | ||
def run(test, params, env): | ||
""" | ||
Test the disk non-default options. | ||
Steps: | ||
1. Boot a VM with packed=true and page-per-vq=true | ||
2. Do some basic I/O operation in the VM | ||
3. Unplug and hotplug the disk | ||
4. Do again a basic I/O operation | ||
: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"]) | ||
vm.verify_alive() | ||
session = vm.wait_for_login(timeout=360) | ||
session.cmd(params.get("dd_cmd")) | ||
|
||
plug = BlockDevicesPlug(vm) | ||
plug.unplug_devs_serial() | ||
plug.hotplug_devs_serial() | ||
session.cmd(params.get("dd_cmd")) |
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,17 @@ | ||
- block_disk_not_default_options: | ||
only virtio_blk, virtio_scsi | ||
type = block_disk_not_default_options | ||
only x86_64 | ||
start_vm = yes | ||
images += " stg0" | ||
boot_drive_stg0 = yes | ||
image_name_stg0 = images/storage0 | ||
image_size_stg0 = 40G | ||
remove_image_stg0 = yes | ||
force_create_image_stg0 = yes | ||
dd_cmd = "dd if=/dev/urandom of=test.txt bs=1M count=10" | ||
virtio_blk: | ||
blk_extra_params_stg0 = "packed=true,page-per-vq=true" | ||
virtio_scsi: | ||
bus_extra_params_stg0 = "packed=true,page-per-vq=true" | ||
drive_bus_stg0 = 1 |