[libvirt] [PATCH 17/23] tests: qemumonitorjson: Add test case for node name detection code

Eric Blake eblake at redhat.com
Thu Mar 23 22:15:39 UTC 2017


On 03/15/2017 11:37 AM, Peter Krempa wrote:
> The code is rather magic so a test case will help making sure that
> everything works well. The first case is a simple backing chain.
> ---
>  .../qemumonitorjson-nodename-1.json                | 268 +++++++++++++++++++++
>  .../qemumonitorjson-nodename-1.result              |  15 ++
>  tests/qemumonitorjsontest.c                        | 116 +++++++++
>  3 files changed, 399 insertions(+)
>  create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-1.json
>  create mode 100644 tests/qemumonitorjsondata/qemumonitorjson-nodename-1.result
> 

> +++ b/tests/qemumonitorjsondata/qemumonitorjson-nodename-1.result
> @@ -0,0 +1,15 @@
> +filename    : '/var/lib/libvirt/images/rhel7.3.1483545313'
> +format node : '#block118'
> +storage node: '#block078'
> +backingfile : '/var/lib/libvirt/images/rhel7.3.1483536402'
> +backing ptr : '#block331'
> +  filename    : '/var/lib/libvirt/images/rhel7.3.1483536402'
> +  format node : '#block331'
> +  storage node: '#block281'
> +  backingfile : '/var/lib/libvirt/images/rhel7.3.qcow2'
> +  backing ptr : '#block567'
> +    filename    : '/var/lib/libvirt/images/rhel7.3.qcow2'
> +    format node : '#block567'
> +    storage node: '#block424'
> +    backingfile : '<null>'
> +    backing ptr : '<null>'

Nice - and you're definitely right that having the test is essential to
maintaining the code.

ACK

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170323/f3b1e46b/attachment-0001.sig>


More information about the libvir-list mailing list