[libvirt] [PATCH v4 6/8] test: Implement bulk snapshot operations

Ján Tomko jtomko at redhat.com
Tue Mar 12 13:29:13 UTC 2019


On Mon, Mar 11, 2019 at 09:38:37PM -0500, Eric Blake wrote:
>Implement the new API calls for bulk snapshot dump and import. The
>bulk of the work is already done by the common code.
>
>Since each connection to test:///default restarts at the same
>canned state, this can easily be tested with:
>
>$ virsh -c test:///default "
>   snapshot-create-as test s1
>   snapshot-create-as test s2
>   echo witness
>   snapshot-dumpxml test --all" | sed '1,/witness/d' > list.xml
>$ virsh -c test:///default "
>   snapshot-list test
>   snapshot-import test list.xml
>   snapshot-current --name test
>   snapshot-list --parent test
>"
> Name   Creation Time   State
>-------------------------------
>
>Imported 2 snapshots
>s2
> Name   Creation Time               State     Parent
>------------------------------------------------------
> s1     2019-02-20 22:26:52 -0600   running
> s2     2019-02-20 22:26:52 -0600   running   s1
>
>The test driver also makes it easy to test input validation, by
>modifying list.xml incorrectly (such as trying to attempt circular
>dependencies).  Proving that that --topological makes a difference
>is a bit harder (since we randomize the hash seed, it is not 100%
>reproducible which order you get without it), but I found that
>creating snapshots s1, s3, s2 in that order tended to be more likely
>to hash in non-topological order without the flag.
>
>Signed-off-by: Eric Blake <eblake at redhat.com>
>---
> src/test/test_driver.c | 62 +++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 61 insertions(+), 1 deletion(-)
>

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20190312/370fadf3/attachment-0001.sig>


More information about the libvir-list mailing list