[libvirt] [PATCH 31/35] tests: qemublock: basic qcow2 tests

Peter Krempa pkrempa at redhat.com
Thu May 3 07:18:11 UTC 2018


On Wed, May 02, 2018 at 19:21:39 -0400, John Ferlan wrote:
> 
> 
> On 04/25/2018 11:15 AM, Peter Krempa wrote:
> > Add tests for backing chain handling, including a very long chain which
> > is fully specified in the XML and an unterminated chain.
> > 
> > The top level disk image would generate the following '-drive':
> > 
> > file-qcow2-backing-chain-encryption.xml:
> > -drive file=/var/lib/libvirt/images/a,encrypt.format=luks,
> >     encrypt.key-secret=node-b-f-encalias,format=qcow2,if=none,id=drive-dummy
> > -device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy
> > 
> > file-qcow2-backing-chain-noopts.xml:
> > -drive file=/var/lib/libvirt/images/rhel7.3.1507297895,format=qcow2,if=none,id=drive-dummy
> > -device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy
> > 
> > file-qcow2-backing-chain-unterminated.xml:
> > -drive file=/var/lib/libvirt/images/rhel7.3.1507297895,format=qcow2,if=none,id=drive-dummy
> > -device virtio-blk-pci,scsi=off,drive=drive-dummy,id=dummy
> > 
> > Signed-off-by: Peter Krempa <pkrempa at redhat.com>
> > ---
> >  tests/qemublocktest.c                              |   3 +
> >  .../file-qcow2-backing-chain-encryption.json       |  34 ++++++
> >  .../file-qcow2-backing-chain-encryption.xml        |  31 +++++
> >  .../xml2json/file-qcow2-backing-chain-noopts.json  | 130 +++++++++++++++++++++
> >  .../xml2json/file-qcow2-backing-chain-noopts.xml   | 113 ++++++++++++++++++
> >  .../file-qcow2-backing-chain-unterminated.json     |  25 ++++
> >  .../file-qcow2-backing-chain-unterminated.xml      |  24 ++++
> >  7 files changed, 360 insertions(+)
> >  create mode 100644 tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encryption.json
> >  create mode 100644 tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-encryption.xml
> >  create mode 100644 tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noopts.json
> >  create mode 100644 tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-noopts.xml
> >  create mode 100644 tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-unterminated.json
> >  create mode 100644 tests/qemublocktestdata/xml2json/file-qcow2-backing-chain-unterminated.xml
> > 
> 
> hahahaha... basic... hahahaha

Oh, right. That was the patch subject prior to adding more of the tests
:)

> and perhaps a more real-life example from -noopts output "#blockNNN"...

Oh, yeah, the node names are super fake (or in the case of the -noopts
test harvested from a real qemu run and then dumped from the status XML)
in all of the tests. The libvirt generated node names will be different,
but for the sake of testing this should be enough.

> Too bad one of those rhel7.3 paths didn't have 3.14159265359 ...

Well, the number after dot is the timestamp when the snapshot was taken.

Your example is still possible:

$ date --date='@14159265359'
Sun Sep  9 10:15:59 CET 2418

If you drop the 9 at the end to get to the correct magnitude you'll get:

$ date --date='@1415926535'
Fri Nov 14 01:55:35 CET 2014

sooo, in 2014, there was no rhel 7.3, and I hope that no sane person
will use rhel 7.3 in year 2418. Maybe rhel 107.3 will be possible at
that time though ;)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180503/5c584503/attachment-0001.sig>


More information about the libvir-list mailing list