[libvirt] [PATCH 5/5] snapshot: Add tests of virsh -c test:///default snapshot*

Daniel P. Berrangé berrange at redhat.com
Wed Mar 27 15:02:47 UTC 2019


On Sat, Mar 23, 2019 at 11:02:03PM -0500, Eric Blake wrote:
> Had this been in place earlier, I would have avoided the bugs in
> commit 0baf6945 and 55c2ab3e. Writing the test required me to extend
> the power of virsh - creating enough snapshots to cause fanout
> requires enough input in a single session that adding comments and
> markers makes it easier to check that output is correct. It's still a
> bit odd that with test:///default, reverting to a snapshot changes the
> domain from running to paused (possibly a bug in how the test driver
> copied from the qemu driver) - but the important part is that the test
> is reproducible, and any future tweaks we make to snapshot code have
> less chance of breaking successful command sequences.
> 
> Signed-off-by: Eric Blake <eblake at redhat.com>
> ---
>  tests/Makefile.am    |   3 +-
>  tests/virsh-snapshot | 212 +++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 214 insertions(+), 1 deletion(-)
>  create mode 100755 tests/virsh-snapshot

This has an unfortunate side-effect. When run it will try to create
$HOME/.cache/libvirt/virsh

This fails if $HOME is not writable - eg running in docker, where
only the VPATH build dir is writable, nothing else:

FAIL: virsh-snapshot
====================
--- exp	2019-03-27 13:27:56.956469010 +0000
+++ err	2019-03-27 13:27:56.952467010 +0000
@@ -1,2 +1,3 @@
 error: invalid argument: parent s3 for snapshot s2 not found
 error: marker
+error: Failed to create '/home/travis/.cache/libvirt/virsh': Permission denied
FAIL virsh-snapshot (exit status: 1)

I'm not sure the right answer for this

 - Require $HOME to be writable
 - Set a fake $HOME under $VPATH (but this won't match /etc/passwd)
 - Don't treat this as fatal

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list