提交 9ef23f38 编写于 作者: A Aihua Liang

block_hotplug:add block_resize after hotplug

Add subtest "block_resize" after hotplug.
Signed-off-by: NAihua Liang <aliang@redhat.com>
上级 08ea8b53
......@@ -109,11 +109,10 @@ def run(test, params, env):
controller = qdevices.QDevice(controller_model, params={"id":
"hotadded_scsi%s" % num})
bus_extra_param = params.get("bus_extra_params_%s" % img_list[num + 1])
# TODO:Add iothread support for qdevice
if bus_extra_param and "iothread" in bus_extra_param:
match = re.search("iothread=(\w+)", bus_extra_param)
if match:
qdevice_params = {"iothread": match.group(1)}
if bus_extra_param:
for item in bus_extra_param.split():
key, value = item.split("=", 1)
qdevice_params = {key: value}
controller.params.update(qdevice_params)
controller.hotplug(vm.monitor)
ver_out = controller.verify_hotplug("", vm.monitor)
......@@ -134,10 +133,10 @@ def run(test, params, env):
if params.get("need_controller", "no") == "yes" and bool(random.randrange(2)):
device.set_param("bus", controller.get_param("id")+'.0')
blk_extra_param = params.get("blk_extra_params_%s" % img_list[num + 1])
if blk_extra_param and "iothread" in blk_extra_param:
match = re.search("iothread=(\w+)", blk_extra_param)
if match:
device.set_param("iothread", match.group(1))
if blk_extra_param:
for item in blk_extra_param.split():
key, value = item.split("=", 1)
device.set_param(key, value)
device.hotplug(vm.monitor)
ver_out = device.verify_hotplug("", vm.monitor)
if not ver_out:
......
......@@ -59,6 +59,42 @@
sub_type_after_plug = boot
sub_type_after_unplug = boot
reboot_method = system_reset
- with_block_resize:
only with_plug
sub_type_after_plug = block_resize
blk_extra_params_stg0 += " serial=TARGET_DISK0"
block_size_cmd = "fdisk -l | grep {0}"
block_size_pattern = ",\s+(\d+\s+b)ytes"
disk_change_ratio = "1.5 0.5"
repeat_times = 1
Windows:
block_size_cmd = "wmic diskdrive get size, index"
block_size_pattern = "1\s+(\d+)"
accept_ratio = 0.0005
disk_update_cmd = "echo rescan > cmd"
disk_update_cmd += " && echo select disk 1 > cmd"
disk_update_cmd += " && echo select partition 1 >> cmd"
disk_update_cmd += " && echo extend >> cmd"
disk_update_cmd += " && echo exit >> cmd"
disk_update_cmd += " && diskpart /s cmd"
# "::" is used to separate the commands as it is not used in both Linux and Windows
disk_update_cmd += "::"
disk_update_cmd += "echo select disk 1 > cmd"
disk_update_cmd += " && echo select partition 1 >> cmd"
disk_update_cmd += " && echo shrink desired=DISK_CHANGE_SIZE >> cmd"
disk_update_cmd += " && echo exit >> cmd && diskpart /s cmd"
disk_unit = M
disk_rescan_cmd = "echo rescan > cmd"
disk_rescan_cmd += " && echo exit >> cmd"
disk_rescan_cmd += " && diskpart /s cmd"
virtio_scsi:
driver_name = vioscsi
virtio_blk:
driver_name = viostor
fmt_qcow2:
disk_change_ratio = 1.5
fmt_raw:
disk_change_ratio = "1.5 0.5"
variants:
- with_plug:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册