You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-15 01:04:37 +02:00
Add HRN_STORAGE_TIME() harness macro.
Makes updating the time of a path/file more streamlined in tests. Also update all tests where utime() was being used directly.
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
/***********************************************************************************************************************************
|
||||
Test Backup Command
|
||||
***********************************************************************************************************************************/
|
||||
#include <utime.h>
|
||||
|
||||
#include "command/stanza/create.h"
|
||||
#include "command/stanza/upgrade.h"
|
||||
#include "common/crypto/hash.h"
|
||||
@ -2571,11 +2569,7 @@ testRun(void)
|
||||
harnessCfgLoad(cfgCmdBackup, argList);
|
||||
|
||||
// Update pg_control timestamp
|
||||
THROW_ON_SYS_ERROR(
|
||||
utime(
|
||||
strZ(storagePathP(storagePg(), STRDEF("global/pg_control"))),
|
||||
&(struct utimbuf){.actime = backupTimeStart, .modtime = backupTimeStart}) != 0, FileWriteError,
|
||||
"unable to set time");
|
||||
HRN_STORAGE_TIME(storagePg(), "global/pg_control", backupTimeStart);
|
||||
|
||||
// Run backup. Make sure that the timeline selected converts to hexdecimal that can't be interpreted as decimal.
|
||||
testBackupPqScriptP(PG_VERSION_11, backupTimeStart, .timeline = 0x2C);
|
||||
|
Reference in New Issue
Block a user