提交 b5d16e4f 编写于 作者: M Mike Qiu 提交者: Lucas Meneghel Rodrigues

kvm.tests.qemu_img:use the same qemu_img_binary to backup and commit

Currently, the commit test just use qemu_img, which
install in the system as default, to make the backup
file, and use the qemu_img_binary which get the path
from env file. Thus may bring some bugs.

For example, if just use the qemu source code and
don't make install to the system(that means the
system haven't installed a qemu to /usr/local/bin
or other system bin path, and autotest just test
the qemu using the git tree), the test will not
find the qemu_img_binary to create the backing_file.

and another problem is the binary used to backup and
commit may be different version, this may cause a bug.

To solve the problem, make the same binary to backup
and commit.
Signed-off-by: NMike Qiu <qiudayu@linux.vnet.ibm.com>
上级 974988e4
......@@ -255,7 +255,6 @@ def run_qemu_img(test, params, env):
@param cmd: qemu-img base command.
"""
cmd += " commit"
logging.info("Commit testing started!")
image_name = params.get("image_name", "image")
......@@ -269,7 +268,7 @@ def run_qemu_img(test, params, env):
os.remove(backing_file)
# Create the new backing file
create_cmd = "qemu-img create -b %s.%s -f %s %s.%s" % (image_name,
create_cmd = "%s create -b %s.%s -f %s %s.%s" % (cmd, image_name,
image_format,
image_format,
backing_file_name,
......@@ -333,7 +332,7 @@ def run_qemu_img(test, params, env):
# Excecute the commit command
logging.info("Commiting image")
cmitcmd = "%s -f %s %s.%s" % (cmd, image_format, backing_file_name,
cmitcmd = "%s commit -f %s %s.%s" % (cmd, image_format, backing_file_name,
image_format)
try:
utils.system(cmitcmd)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册