Currently, the commit test just use qemu_img, which install in the
system as default, to make the bakeup file, and use the qemu_img_binary
which get the path from evn file. Thus may make 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: Mike Qiu <[email protected]>
---
 client/tests/kvm/tests/qemu_img.py |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/client/tests/kvm/tests/qemu_img.py 
b/client/tests/kvm/tests/qemu_img.py
index 8792688..2cdcf03 100644
--- a/client/tests/kvm/tests/qemu_img.py
+++ b/client/tests/kvm/tests/qemu_img.py
@@ -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)
-- 
1.7.1

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to