You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-06-18 23:57:33 +02:00
Add repoIsLocalVerify() to verify repository locality.
Some commands can only be run on a host where the repository is local. This function centralizes the check and error. Contributed by Cynthia Shang.
This commit is contained in:
committed by
David Steele
parent
6a09d9294d
commit
27e8235812
@ -75,6 +75,7 @@ testRun(void)
|
||||
harnessCfgLoad(strLstSize(argList), strLstPtr(argList));
|
||||
|
||||
TEST_RESULT_BOOL(repoIsLocal(), true, "repo is local");
|
||||
TEST_RESULT_VOID(repoIsLocalVerify(), " local verified");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
argList = strLstNew();
|
||||
@ -85,6 +86,7 @@ testRun(void)
|
||||
harnessCfgLoad(strLstSize(argList), strLstPtr(argList));
|
||||
|
||||
TEST_RESULT_BOOL(repoIsLocal(), false, "repo is remote");
|
||||
TEST_ERROR_FMT(repoIsLocalVerify(), HostInvalidError, "archive-get command must be run on the repository host");
|
||||
|
||||
// -------------------------------------------------------------------------------------------------------------------------
|
||||
argList = strLstNew();
|
||||
|
Reference in New Issue
Block a user