1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-13 01:00:23 +02:00

Move WAL path prefix logic into walPath().

This logic is used by both archive-push and archive-get.
This commit is contained in:
David Steele
2019-03-16 16:14:10 +04:00
parent 12273a1034
commit 2d386cd266
7 changed files with 62 additions and 8 deletions

View File

@ -168,6 +168,20 @@ testRun(void)
TEST_RESULT_BOOL(walIsSegment(strNew("0000001A.history")), false, "history file");
}
// *****************************************************************************************************************************
if (testBegin("walPath()"))
{
TEST_RESULT_STR(
strPtr(walPath(strNew("/absolute/path"), strNew("/pg"), strNew("test"))), "/absolute/path", "absolute path");
TEST_RESULT_STR(
strPtr(walPath(strNew("relative/path"), strNew("/pg"), strNew("test"))), "/pg/relative/path", "relative path");
TEST_ERROR(
walPath(strNew("relative/path"), NULL, strNew("test")), OptionRequiredError,
"option 'pg1-path' must be specified when relative wal paths are used\n"
"HINT: Is %f passed to test instead of %p?\n"
"HINT: PostgreSQL may pass relative paths even with %p depending on the environment.");
}
// *****************************************************************************************************************************
if (testBegin("walSegmentFind()"))
{