]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: test-http-payload - Use the new test-dir API
authorStephan Bosch <stephan.bosch@open-xchange.com>
Sat, 1 Nov 2025 18:59:41 +0000 (19:59 +0100)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Wed, 5 Nov 2025 10:17:48 +0000 (10:17 +0000)
src/lib-http/test-http-payload.c

index 115c44934c00e962c4090d6b46938c6422b23ab4..07afb5b21a79c6a40fe153b9a58668023a62eebd 100644 (file)
@@ -16,6 +16,7 @@
 #include "iostream-openssl.h"
 #include "connection.h"
 #include "test-common.h"
+#include "test-dir.h"
 #include "test-subprocess.h"
 #include "http-url.h"
 #include "http-request.h"
@@ -44,6 +45,7 @@ static const char *failure = NULL;
 static struct timeout *to_continue = NULL;
 static bool files_finished = FALSE;
 static bool running_continue = FALSE;
+static char *tmp_dir = NULL;
 
 static struct test_settings {
        /* client */
@@ -613,7 +615,8 @@ client_handle_echo_request(struct client_request *creq,
                return;
        }
 
-       payload_output = iostream_temp_create("/tmp/test-http-server", 0);
+       payload_output = iostream_temp_create(
+               t_strconcat(tmp_dir, "/payload.tmp.", NULL), 0);
 
        if (tset.server_blocking) {
                struct istream *payload_input;
@@ -2440,6 +2443,8 @@ static void main_init(void)
        event_set_append_log_prefix(client_event, "test client: ");
        server_event = event_create(common_event);
        event_set_append_log_prefix(server_event, "test server: ");
+
+       tmp_dir = i_strdup(test_dir_get());
 }
 
 static void main_deinit(void)
@@ -2449,6 +2454,8 @@ static void main_deinit(void)
        event_unref(&client_event);
        event_unref(&server_event);
        common_event = NULL;
+
+       i_free(tmp_dir);
 }
 
 int main(int argc, char *argv[])
@@ -2473,6 +2480,7 @@ int main(int argc, char *argv[])
 
        test_init();
        event_set_forced_debug(test_event, debug);
+       test_dir_init("http-payload");
        test_subprocesses_init();
        main_init();