/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file
*/
#include "lib.h"
#include "test-lib.h"
#include "buffer.h"
#include "str.h"
#include "istream.h"
#include "istream-concat.h"
#include "ostream.h"
#include "lib-signals.h"
#include "program-client.h"
static const char *pclient_test_io_string = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n"
"Praesent vehicula ac leo vel placerat. Nullam placerat \n"
"volutpat leo, sed ultricies felis pulvinar quis. Nam \n"
"tempus, augue ut tempor cursus, neque felis commodo lacus, \n"
"sit amet tincidunt arcu justo vel augue. Proin dapibus \n"
"vulputate maximus. Mauris congue lacus felis, sed varius \n"
"leo finibus sagittis. Cum sociis natoque penatibus et magnis \n"
"dis parturient montes, nascetur ridiculus mus. Aliquam \n"
"laoreet arcu a hendrerit consequat. Duis vitae erat tellus.";
static
.client_connect_timeout_msecs = 5000,
.input_idle_timeout_msecs = 1000,
.restrict_set = {
},
/* we need to permit root when running make check as root */
.allow_root = TRUE,
};
static
void test_program_success(void) {
test_begin("test_program_success");
const char *const args[] = {
};
o_stream_unref(&os);
test_end();
}
static
void test_program_io_sync(void) {
test_begin("test_program_io (sync)");
const char *const args[] = {
};
i_stream_unref(&is);
o_stream_unref(&os);
test_end();
}
static
{
}
static
void test_program_io_async(void) {
test_begin("test_program_io (async)");
const char *const args[] = {
};
if (ret == -2)
i_stream_unref(&is);
o_stream_unref(&os);
test_end();
}
static
void test_program_failure(void) {
test_begin("test_program_failure");
const char *const args[] = {
};
o_stream_unref(&os);
test_end();
}
static
void test_program_io_big(void) {
test_begin("test_program_io (big)");
/* nasty program that reads data in bits with intermittent delays
and then finally reads the rest in one go. */
const char *const args[] = {
"-c",
"(head -c 10240; sleep 0.1; "
"head -c 10240; sleep 0.1; "
"head -c 10240; sleep 0.1; "
"head -c 10240; sleep 0.1; "
"head -c 10240; sleep 0.1; "
"head -c 10240; sleep 0.1; cat)",
};
/* make big input with only a small reference string */
i_stream_unref(&is);
o_stream_unref(&os);
test_end();
}
int main(void)
{
int ret;
void (*tests[])(void) = {
};
lib_init();
lib_deinit();
return ret;
}