[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[qemu-xen master] iotests: Add more qemu_img helpers



commit 4b914b01cdb95fe5722cb70826db7f0a262e8d2a
Author:     Nir Soffer <nirsof@xxxxxxxxx>
AuthorDate: Tue Jul 28 00:58:45 2020 +0300
Commit:     Eric Blake <eblake@xxxxxxxxxx>
CommitDate: Tue Jul 28 09:54:43 2020 -0500

    iotests: Add more qemu_img helpers
    
    Add 2 helpers for measuring and checking images:
    - qemu_img_measure()
    - qemu_img_check()
    
    Both use --output-json and parse the returned json to make easy to use
    in other tests. I'm going to use them in a new test, and I hope they
    will be useful in may other tests.
    
    Signed-off-by: Nir Soffer <nsoffer@xxxxxxxxxx>
    Message-Id: <20200727215846.395443-4-nsoffer@xxxxxxxxxx>
    Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@xxxxxxxxxxxxx>
    Signed-off-by: Eric Blake <eblake@xxxxxxxxxx>
---
 tests/qemu-iotests/iotests.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
index 8f79668435..717b5b652c 100644
--- a/tests/qemu-iotests/iotests.py
+++ b/tests/qemu-iotests/iotests.py
@@ -141,6 +141,12 @@ def qemu_img_create(*args):
 
     return qemu_img(*args)
 
+def qemu_img_measure(*args):
+    return json.loads(qemu_img_pipe("measure", "--output", "json", *args))
+
+def qemu_img_check(*args):
+    return json.loads(qemu_img_pipe("check", "--output", "json", *args))
+
 def qemu_img_verbose(*args):
     '''Run qemu-img without suppressing its output and return the exit code'''
     exitcode = subprocess.call(qemu_img_args + list(args))
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#master



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.