struct pakfire_ctx* ctx = NULL;
struct pakfire* p = NULL;
FILE* c = NULL;
-
- char root[PATH_MAX] = TEST_ROOTFS "/pakfire-test-XXXXXX";
int r;
- // Create test root directory
- 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);
+ LOG("running %s\n", t->name);
// Create a new context
r = pakfire_ctx_create(&t->ctx, TEST_CONFIG_FILE);
// Create a pakfire instance (if requested)
if (t->flags & TEST_WANTS_PAKFIRE) {
- r = pakfire_create(&t->pakfire, t->ctx, root, NULL, c, 0);
- if (r) {
- LOG("ERROR: Could not initialize pakfire: %m\n");
+ r = pakfire_create(&t->pakfire, t->ctx, NULL, NULL, c, 0);
+ if (r < 0) {
+ LOG("ERROR: Could not initialize pakfire: %s\n", strerror(-r));
goto ERROR;
}
// Create a HTTP client (if requested)
if (t->flags & TEST_WANTS_HTTPCLIENT) {
r = pakfire_httpclient_create(&t->httpclient, t->ctx, NULL);
- if (r) {
+ if (r < 0) {
LOG("ERROR: Could not initialize the HTTP client: %s\n", strerror(-r));
goto ERROR;
}
if (c)
fclose(c);
- // Cleanup root
- pakfire_rmtree(root, 0);
-
return r;
}