#include <unistd.h>
#include <dirent.h>
-#define CLIENT_PROGRESS_TIMEOUT 60
-#define SERVER_KILL_TIMEOUT_SECS 20
-#define MAX_PARALLEL_PENDING 200
+#define VALGRIND_TIMEOUT_MULTIPLIER (ON_VALGRIND ? 5 : 1)
+
+#define CLIENT_PROGRESS_TIMEOUT_MSECS (60 * VALGRIND_TIMEOUT_MULTIPLIER * 1000)
+#define SERVER_KILL_TIMEOUT_SECS (20 * VALGRIND_TIMEOUT_MULTIPLIER)
+#define MAX_PARALLEL_PENDING 200
static bool debug = FALSE;
static bool small_socket_buffers = FALSE;
if (!small_socket_buffers) {
to_client_progress = timeout_add(
- CLIENT_PROGRESS_TIMEOUT*1000,
+ CLIENT_PROGRESS_TIMEOUT_MSECS,
test_client_progress_timeout, NULL);
}
smtp_server_set.protocol = protocol;
smtp_server_set.capabilities = capabilities;
smtp_server_set.hostname = "localhost";
- smtp_server_set.max_client_idle_time_msecs =
- CLIENT_PROGRESS_TIMEOUT*1000;
+ smtp_server_set.max_client_idle_time_msecs = CLIENT_PROGRESS_TIMEOUT_MSECS;
smtp_server_set.max_pipelined_commands = 1;
smtp_server_set.auth_optional = TRUE;
smtp_server_set.ssl = &ssl_server_set;
i_zero(&smtp_client_set);
smtp_client_set.my_hostname = "localhost";
smtp_client_set.temp_path_prefix = "/tmp";
- smtp_client_set.command_timeout_msecs = CLIENT_PROGRESS_TIMEOUT*1000;
- smtp_client_set.connect_timeout_msecs = CLIENT_PROGRESS_TIMEOUT*1000;
+ smtp_client_set.command_timeout_msecs = CLIENT_PROGRESS_TIMEOUT_MSECS;
+ smtp_client_set.connect_timeout_msecs = CLIENT_PROGRESS_TIMEOUT_MSECS;
smtp_client_set.ssl = &ssl_client_set;
smtp_client_set.debug = debug;
#ifndef TEST_COMMON_H
#define TEST_COMMON_H
+#ifdef HAVE_VALGRIND_VALGRIND_H
+# include <valgrind/valgrind.h>
+# define ON_VALGRIND ((bool) RUNNING_ON_VALGRIND)
+#else
+# define ON_VALGRIND FALSE
+#endif
+
struct istream *test_istream_create(const char *data);
struct istream *test_istream_create_data(const void *data, size_t size);
void test_istream_set_size(struct istream *input, uoff_t size);