提交 bd65ff14 编写于 作者: C Cong Li

qemu.tests.block_copy: Update set_speed() to make it support more speeds.

And add more speeds test scenarios for block_stream.
Signed-off-by: NCong Li <coli@redhat.com>
上级 c202a31b
......@@ -177,14 +177,15 @@ class BlockCopy(object):
"""
params = self.parser_test_args()
max_speed = params.get("max_speed")
error.context("set max speed to %s B/s" % max_speed, logging.info)
self.vm.set_job_speed(self.device, max_speed)
expected_speed = int(params.get("expected_speed", max_speed))
error.context("set speed to %s B/s" % expected_speed, logging.info)
self.vm.set_job_speed(self.device, expected_speed)
status = self.get_status()
if not status:
raise error.TestFail("Unable to query job status.")
speed = status["speed"]
if speed != max_speed:
msg = "Set speed fail. (expect speed: %s B/s," % max_speed
if speed != expected_speed:
msg = "Set speed fail. (expected speed: %s B/s," % expected_speed
msg += "actual speed: %s B/s)" % speed
raise error.TestFail(msg)
......
......@@ -30,6 +30,11 @@
when_streaming = "set_speed"
max_speed_image1 = 10M
after_finished = "reboot verify_alive"
variants:
- max_speed:
expected_speed_image1 = 10485760
- min_speed:
expected_speed_image1 = 10
- cancel_sync:
wait_finished = no
cancel_timeout_image1 = 3
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册