]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
tests: remove the temp container directory
authorLong Wang <w@laoqinren.net>
Wed, 5 Jul 2017 07:17:58 +0000 (15:17 +0800)
committerLong Wang <w@laoqinren.net>
Wed, 5 Jul 2017 07:17:58 +0000 (15:17 +0800)
c->destory() will not remove the temp container directory.
This patch fix that.

Signed-off-by: Long Wang <w@laoqinren.net>
src/tests/parse_config_file.c

index 0c9d717ec3145ee0c0b43cf4327fa79b175bbaf0..dc4b586a6e896464250359e9ebe37f13bbfb8004 100644 (file)
@@ -26,6 +26,7 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <unistd.h>
+#include <libgen.h>
 
 #include "confile_utils.h"
 #include "lxc/state.h"
@@ -985,7 +986,7 @@ int main(int argc, char *argv[])
        ret = EXIT_SUCCESS;
 non_test_error:
        (void)unlink(tmpf);
-       c->destroy(c);
+       (void)rmdir(dirname(c->configfile));
        lxc_container_put(c);
        exit(ret);
 }