]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-smtp: test-smtp-submit - Add log prefixes to distinguish client and server debug...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Thu, 9 Apr 2020 08:37:28 +0000 (10:37 +0200)
committerStephan Bosch <stephan.bosch@open-xchange.com>
Mon, 25 May 2020 15:29:02 +0000 (17:29 +0200)
src/lib-smtp/test-smtp-submit.c

index 6f725a2ead5717277188eb0636ebdf769fa8f688..5be90843cbca0641759acc24b683d958e1907957 100644 (file)
@@ -2112,11 +2112,10 @@ test_run_client_server(const struct smtp_submit_settings *submit_set,
                                        io_loop_destroy(&ioloop);
                                }
                                lib_signals_deinit();
-                               if (debug) {
-                                       i_debug("server[%d]: PID=%s",
-                                               i + 1, my_pid);
-                               }
                                /* child: server */
+                               i_set_failure_prefix("SERVER[%u]: ", i + 1);
+                               if (debug)
+                                       i_debug("PID=%s", my_pid);
                                ioloop = io_loop_create();
                                server_test(i);
                                io_loop_destroy(&ioloop);
@@ -2134,13 +2133,13 @@ test_run_client_server(const struct smtp_submit_settings *submit_set,
                        if (fd_listen != -1)
                                i_close_fd(&fd_listen);
                }
-               if (debug)
-                       i_debug("client: PID=%s", my_pid);
-
                lib_signals_ioloop_attach();
        }
 
        /* parent: client */
+       i_set_failure_prefix("CLIENT: ");
+       if (debug)
+               i_debug("PID=%s", my_pid);
 
        i_sleep_msecs(100); /* wait a little for server setup */
        server_port = 0;
@@ -2151,6 +2150,7 @@ test_run_client_server(const struct smtp_submit_settings *submit_set,
        test_client_deinit();
        io_loop_destroy(&ioloop);
 
+       i_unset_failure_prefix();
        test_servers_kill_all();
        i_free(server_pids);
        i_free(bind_ports);