1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-03-05 15:05:48 +02:00

Add some debugging to tests that fork servers.

Help identify whether errors are happening in the forked server or the main test by showing the line number where the server was forked off in the stack trace.
This commit is contained in:
David Steele 2020-04-07 14:56:09 -04:00
parent 099bd85ed7
commit c292e8957d
3 changed files with 20 additions and 4 deletions

View File

@ -12,6 +12,8 @@ Test server
static void
testHttpServer(void)
{
FUNCTION_HARNESS_VOID();
if (fork() == 0)
{
// Change log process id to aid in debugging
@ -317,6 +319,8 @@ testHttpServer(void)
exit(0);
}
FUNCTION_HARNESS_RESULT_VOID();
}
/***********************************************************************************************************************************
@ -452,7 +456,7 @@ testRun(void)
"unable to connect to 'localhost:%u': [111] Connection refused", harnessTlsTestPort());
// Start http test server
testHttpServer();
TEST_RESULT_VOID(testHttpServer(), "http server begin");
// Test no output from server
TEST_ASSIGN(

View File

@ -14,6 +14,8 @@ Test server with subject alternate names
static void
testTlsServerAltName(void)
{
FUNCTION_HARNESS_VOID();
if (fork() == 0)
{
// Change log process id to aid in debugging
@ -53,6 +55,8 @@ testTlsServerAltName(void)
exit(0);
}
FUNCTION_HARNESS_RESULT_VOID();
}
/***********************************************************************************************************************************
@ -61,6 +65,8 @@ Test server
static void
testTlsServer(void)
{
FUNCTION_HARNESS_VOID();
if (fork() == 0)
{
// Change log process id to aid in debugging
@ -95,6 +101,8 @@ testTlsServer(void)
exit(0);
}
FUNCTION_HARNESS_RESULT_VOID();
}
/***********************************************************************************************************************************
@ -279,7 +287,7 @@ testRun(void)
}
// Start server to test various certificate errors
testTlsServerAltName();
TEST_RESULT_VOID(testTlsServerAltName(), "tls alt name server begin");
TEST_ERROR(
tlsClientOpen(
@ -342,7 +350,7 @@ testRun(void)
tlsClientStatLocal = (TlsClientStat){0};
TEST_RESULT_PTR(tlsClientStatStr(), NULL, "no stats yet");
testTlsServer();
TEST_RESULT_VOID(testTlsServer(), "tls server begin");
ioBufferSizeSet(12);
TEST_ASSIGN(

View File

@ -85,6 +85,8 @@ testS3ServerResponse(unsigned int code, const char *message, const char *header,
static void
testS3Server(void)
{
FUNCTION_HARNESS_VOID();
if (fork() == 0)
{
// Change log process id to aid in debugging
@ -520,6 +522,8 @@ testS3Server(void)
harnessTlsServerClose();
exit(0);
}
FUNCTION_HARNESS_RESULT_VOID();
}
/***********************************************************************************************************************************
@ -755,7 +759,7 @@ testRun(void)
// *****************************************************************************************************************************
if (testBegin("storageS3*(), StorageReadS3, and StorageWriteS3"))
{
testS3Server();
TEST_RESULT_VOID(testS3Server(), "s3 server begin");
Storage *s3 = storageS3New(
path, true, NULL, bucket, endPoint, storageS3UriStyleHost, region, accessKey, secretAccessKey, NULL, 16, 2, host, port,