[lxc-devel] [PATCH] use snapshot_destroy in tests/snapshot.c and clean containers after the test
S.Çağlar Onur
caglar at 10ur.org
Wed Oct 16 23:16:06 UTC 2013
Signed-off-by: S.Çağlar Onur <caglar at 10ur.org>
---
src/tests/snapshot.c | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/tests/snapshot.c b/src/tests/snapshot.c
index 8f16548..ef3f9c2 100644
--- a/src/tests/snapshot.c
+++ b/src/tests/snapshot.c
@@ -118,8 +118,19 @@ int main(int argc, char *argv[])
goto err;
}
- printf("All tests passed\n");
+ if (!c->snapshot_destroy(c, "snap0")) {
+ fprintf(stderr, "%s: %d: failed to destroy snapshot\n", __FILE__, __LINE__);
+ goto err;
+ }
+
+ if (!c->destroy(c)) {
+ fprintf(stderr, "%s: %d: failed to destroy container\n", __FILE__, __LINE__);
+ goto err;
+ }
+
lxc_container_put(c);
+ printf("All tests passed\n");
+ try_to_remove();
exit(0);
err:
--
1.8.1.2
More information about the lxc-devel
mailing list