[lxc-devel] [PATCH 2/1] snapshot test: make sure that external snapshot was really created
Stéphane Graber
stgraber at ubuntu.com
Wed Jun 18 20:54:32 UTC 2014
On Mon, Jun 02, 2014 at 08:53:16AM -0500, Serge Hallyn wrote:
> Quoting S.Çağlar Onur (caglar at 10ur.org):
> > Serge, I believe you can ignore this problem for now. Looks like it is
> > not an issue if you do a fresh compilation. To reproduce, you need to
> > start with compiling master (and then installing it on to your system)
> > and then applying your patch on top of that and do a make followed by
> > make install.
> >
> > My tests started to pass again expect one where I restore a snapshot
> > as a new container. I'll debug more to see whether it's related with
> > LXC or Go bindings cause as long as I see lxc-snapshot command works
> > fine for that case.
>
> The following tiny patch tests to make sure that external snapshots
> are in fact creating a container (not just blindly returning
> success)
>
> From efe44c7d20be4962337150e82fb96e87fe6d6685 Mon Sep 17 00:00:00 2001
> From: Serge Hallyn <serge.hallyn at ubuntu.com>
> Date: Mon, 2 Jun 2014 08:50:35 -0500
> Subject: [PATCH 2/1] snapshot test: make sure that external snapshot was
> really created
>
> Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>
> ---
> src/tests/snapshot.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/src/tests/snapshot.c b/src/tests/snapshot.c
> index 21acd3e..b035096 100644
> --- a/src/tests/snapshot.c
> +++ b/src/tests/snapshot.c
> @@ -126,6 +126,12 @@ int main(int argc, char *argv[])
> goto err;
> }
>
> + c2 = lxc_container_new(RESTNAME, NULL);
> + if (!c2 || !c2->is_defined(c2)) {
> + fprintf(stderr, "%s: %d: external snapshot restore failed\n", __FILE__, __LINE__);
> + goto err;
> + }
> + lxc_container_put(c2);
>
> c2 = c->clone(c, MYNAME2, NULL, LXC_CLONE_SNAPSHOT, "overlayfs", NULL, 0, NULL);
> if (!c2) {
> --
> 2.0.0
>
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel
--
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140618/d9544ae4/attachment.sig>
More information about the lxc-devel
mailing list