]> git.ipfire.org Git - people/stevee/pakfire.git/commitdiff
tests: Cleanup temporary directories
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Aug 2022 12:53:20 +0000 (12:53 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 9 Aug 2022 12:53:20 +0000 (12:53 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/testsuite.c

index 01e7aacc413e2fb0bb563c2a0a94b58ead66a3d4..cd4efe01efd800d3d6cdf54f79a70372822cca10 100644 (file)
 struct testsuite ts;
 
 static int test_run(int i, struct test* t) {
-       char root[PATH_MAX];
+       char root[PATH_MAX] = TEST_ROOTFS "/pakfire-test-XXXXXX";
        int r;
 
        // Create test root directory
-       snprintf(root, PATH_MAX - 1, "%s/pakfire-test-XXXXXX", TEST_ROOTFS);
        char* tmp = pakfire_mkdtemp(root);
        if (!tmp) {
                LOG("Could not create temporary directory %s: %m\n", root);
@@ -68,7 +67,7 @@ static int test_run(int i, struct test* t) {
        }
 
        // Cleanup root
-       // TODO
+       pakfire_rmtree(root, 0);
 
        return r;
 }