1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-06-14 23:44:58 +02:00

Fixed an issue passing parameters to remotes.

When more than one db was specified the path, port, and socket path would for db1 were passed no matter which db was actually being addressed.

Reported by Uspen.
This commit is contained in:
David Steele
2017-11-21 13:17:44 -05:00
parent c77fc1fa61
commit ac54aac448
3 changed files with 18 additions and 7 deletions

View File

@ -88,13 +88,16 @@ sub run
$self->optionTestSet(cfgOptionIdFromIndex(CFGOPT_DB_PATH, 1), '/db1');
$self->optionTestSet(cfgOptionIdFromIndex(CFGOPT_DB_PORT, 1), '1111');
$self->optionTestSet(cfgOptionIdFromIndex(CFGOPT_DB_CMD, 1), 'pgbackrest1');
$self->optionTestSet(cfgOptionIdFromIndex(CFGOPT_DB_HOST, 2), 'db-host-2');
$self->optionTestSet(cfgOptionIdFromIndex(CFGOPT_DB_PATH, 2), '/db2');
$self->optionTestSet(cfgOptionIdFromIndex(CFGOPT_DB_PORT, 2), '2222');
$self->optionTestSet(cfgOptionIdFromIndex(CFGOPT_DB_CMD, 2), 'pgbackrest2');
$self->configTestLoad(CFGCMD_BACKUP);
$self->testResult(
sub {pgBackRest::Protocol::Helper::protocolParam(
cfgCommandName(CFGCMD_BACKUP), CFGOPTVAL_REMOTE_TYPE_DB, 1)},
'(db-host-1, postgres, [undef], pgbackrest1 --buffer-size=4194304 --command=backup --compress-level=6' .
' --compress-level-network=3 --db1-path=/db1 --db1-port=1111 --protocol-timeout=1830 --stanza=db --type=db remote)',
sub {pgBackRest::Protocol::Helper::protocolParam(cfgCommandName(CFGCMD_BACKUP), CFGOPTVAL_REMOTE_TYPE_DB, 2)},
'(db-host-2, postgres, [undef], pgbackrest2 --buffer-size=4194304 --command=backup --compress-level=6' .
' --compress-level-network=3 --db1-path=/db2 --db1-port=2222 --protocol-timeout=1830 --stanza=db --type=db remote)',
'more than one backup db host');
}