提交 499f3097 编写于 作者: X Xu Tian

tp-qemu: update unplug disk test steps

Signed-off-by: NXu Tian <xutian@redhat.com>
上级 cf42ce76
......@@ -15,11 +15,14 @@
Linux:
# We have multiple disks so just ignor first one of each type
no_stress_cmds = 100
stress_cmd = "touch /tmp/disk_stress ; "
stress_cmd += "while [ -f /tmp/disk_stress ] ; do "
stress_cmd += "READ=`ls /dev/[shv]d[a-z]* | egrep -v '^/dev/[vhs]da[0-9]*$' | sort -R | tail -n 1` ;"
stress_cmd += "WRITE=`ls /dev/[shv]d[a-z]* | egrep -v '^/dev/[vhs]da[0-9]*$' | sort -R | tail -n 1` ;"
stress_cmd += "dd if=$READ of=$WRITE bs=1k count=10 iflag=direct oflag=direct conv=nocreat; done &>/dev/null &"
stress_cmd = 'sh -c " touch /tmp/disk_stress ; '
stress_cmd += 'while [ -f /tmp/disk_stress ] ; do '
stress_cmd += 'READ=`ls /dev/[shv]d[a-z]* | egrep -v '^/dev/[vhs]da[0-9]*$' | sort -R | tail -n 1` ;'
stress_cmd += 'WRITE=`ls /dev/[shv]d[a-z]* | egrep -v '^/dev/[vhs]da[0-9]*$' | sort -R | tail -n 1` ;'
stress_cmd += 'dd if=$READ of=$WRITE bs=1k count=10 iflag=direct oflag=direct conv=nocreat; done >/dev/null" &'
stress_cmd += 'echo $! > /tmp/disk_stress'
stress_stop_cmd = kill -19 `cat /tmp/disk_stress`
stress_cont_cmd = kill -18 `cat /tmp/disk_stress`
stress_kill_cmd = "rm -f /tmp/disk_stress"
variants:
- all_types:
......
......@@ -77,10 +77,11 @@ def run(test, params, env):
1) prepares multiple disks to be hotplugged
2) hotplugs them
3) verifies that they are in qtree/guest system/...
4) unplugs them
5) verifies they are not in qtree/guest system/...
6) repeats $repeat_times
*) During the whole test stress_cmd might be executed
4) stop I/O stress_cmd
5) unplugs them
6) continue I/O stress_cmd
7) verifies they are not in qtree/guest system/...
8) repeats $repeat_times
:param test: QEMU test object
:param params: Dictionary with the test parameters
......@@ -448,7 +449,11 @@ def run(test, params, env):
utils_test.run_virt_sub_test(test, params, env, sub_type)
error.context("Unplug and remove the devices", logging.debug)
if stress_cmd:
session.cmd(params["stress_stop_cmd"])
unplug(new_devices, qdev, monitor)
if stress_cmd:
session.cmd(params["stress_cont_cmd"])
_postprocess_images()
error.context("Verify disks after unplug", logging.debug)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册