Commit 58b61f6d by S.Çağlar Onur Committed by Serge Hallyn

use snapshot_destroy in tests/snapshot.c and clean up containers after the test run

parent 771d96b3
......@@ -118,13 +118,25 @@ 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);
exit(0);
try_to_remove();
printf("All tests passed\n");
exit(0);
err:
lxc_container_put(c);
fprintf(stderr, "Exiting on error\n");
try_to_remove();
fprintf(stderr, "Exiting on error\n");
exit(1);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment