]> git.ipfire.org Git - pakfire.git/commitdiff
testsuite: Fix creating temporary test directories
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Jun 2021 17:14:38 +0000 (17:14 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 10 Jun 2021 17:14:38 +0000 (17:14 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
tests/testsuite.c

index b211b3d277df7a51913debee16998849cdbf001b..25e7c78312dd5b00802252a3a647898616ccde33 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <pakfire/logging.h>
 #include <pakfire/pakfire.h>
+#include <pakfire/util.h>
 
 struct testsuite ts;
 
@@ -35,8 +36,11 @@ static int test_run(int i, struct test* t) {
 
        // Create test root directory
        snprintf(root, PATH_MAX - 1, "%s/pakfire-test-XXXXXX", TEST_ROOTFS);
-       char* tmp = mkdtemp(root);
-       ASSERT(root == tmp);
+       char* tmp = pakfire_mkdtemp(root);
+       if (!tmp) {
+               LOG("Could not create temporary directory %s: %m\n", root);
+               exit(1);
+       }
 
        LOG("running %s (%s)\n", t->name, root);