1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-07 00:35:37 +02:00

Add HRN_PG_CONTROL_PUT() and HRN_PG_CONTROL_TIME().

These macros simplify management of pg_control test files.

Centralize time updates for pg_control in the command/backup module. This caused some time updates in the logs.

Finally, move the postgres module after the storage module so it can use storage macros.
This commit is contained in:
David Steele
2021-11-30 13:23:11 -05:00
parent 01ac6b6cac
commit 0895cfcdf7
8 changed files with 81 additions and 118 deletions

View File

@ -150,8 +150,7 @@ testRun(void)
HRN_CFG_LOAD(cfgCmdCheck, argList);
// Create pg_control for standby
HRN_STORAGE_PUT(
storagePgWrite(), PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, hrnPgControlToBuffer((PgControl){.version = PG_VERSION_92}));
HRN_PG_CONTROL_PUT(storagePgWrite(), PG_VERSION_92);
// Standby database path doesn't match pg_control
harnessPqScriptSet((HarnessPq [])
@ -175,9 +174,7 @@ testRun(void)
TEST_TITLE("standby and primary database - error on primary but standby check ok");
// Create pg_control for primary
HRN_STORAGE_PUT(
storagePgIdxWrite(1), PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL,
hrnPgControlToBuffer((PgControl){.version = PG_VERSION_92}));
HRN_PG_CONTROL_PUT(storagePgIdxWrite(1), PG_VERSION_92);
// Create info files
HRN_INFO_PUT(
@ -571,9 +568,7 @@ testRun(void)
HRN_CFG_LOAD(cfgCmdStanzaCreate, argList);
// Create pg_control
HRN_STORAGE_PUT(
storagePgIdxWrite(0), PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL,
hrnPgControlToBuffer((PgControl){.version = PG_VERSION_96}));
HRN_PG_CONTROL_PUT(storagePgIdxWrite(0), PG_VERSION_96);
// Create info files
TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - encryption");