1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-11-06 08:49:29 +02:00

Fixed an issue where an absolute path was not written into recovery.conf when the restore was run with a relative path.

This commit is contained in:
David Steele
2015-05-07 17:37:25 -05:00
parent 1ac4b781fd
commit a0d985b7ad
10 changed files with 97 additions and 79 deletions

View File

@@ -251,7 +251,7 @@ sub BackRestTestBackup_ClusterStart
}
# Creat the archive command
my $strArchive = BackRestTestCommon_CommandMainGet() . ' --stanza=' . BackRestTestCommon_StanzaGet() .
my $strArchive = BackRestTestCommon_CommandMainAbsGet() . ' --stanza=' . BackRestTestCommon_StanzaGet() .
' --config=' . BackRestTestCommon_DbPathGet() . '/pg_backrest.conf archive-push %p';
# Start the cluster
@@ -869,7 +869,8 @@ sub BackRestTestBackup_BackupBegin
$strComment = "${strType} backup" . (defined($strComment) ? " (${strComment})" : '');
&log(INFO, " $strComment");
BackRestTestCommon_ExecuteBegin(BackRestTestCommon_CommandMainGet() . ' --config=' .
BackRestTestCommon_ExecuteBegin(($bRemote ? BackRestTestCommon_CommandMainAbsGet() : BackRestTestCommon_CommandMainGet()) .
' --config=' .
($bRemote ? BackRestTestCommon_RepoPathGet() : BackRestTestCommon_DbPathGet()) .
"/pg_backrest.conf" . ($bSynthetic ? " --no-start-stop" : '') .
(defined($strOptionalParam) ? " ${strOptionalParam}" : '') .
@@ -1228,7 +1229,8 @@ sub BackRestTestBackup_Restore
}
# Create the backup command
BackRestTestCommon_Execute(BackRestTestCommon_CommandMainGet() . ' --config=' . BackRestTestCommon_DbPathGet() .
BackRestTestCommon_Execute(($bRemote ? BackRestTestCommon_CommandMainAbsGet() : BackRestTestCommon_CommandMainGet()) .
' --config=' . BackRestTestCommon_DbPathGet() .
'/pg_backrest.conf' . (defined($bDelta) && $bDelta ? ' --delta' : '') .
(defined($bForce) && $bForce ? ' --force' : '') .
($strBackup ne 'latest' ? " --set=${strBackup}" : '') .

View File

@@ -41,7 +41,7 @@ our @EXPORT = qw(BackRestTestCommon_Create BackRestTestCommon_Drop BackRestTestC
BackRestTestCommon_DbCommonPathGet BackRestTestCommon_ClusterStop BackRestTestCommon_DbTablespacePathGet
BackRestTestCommon_DbPortGet BackRestTestCommon_iniLoad BackRestTestCommon_iniSave BackRestTestCommon_DbVersion
BackRestTestCommon_CommandPsqlGet BackRestTestCommon_DropRepo BackRestTestCommon_CreateRepo
BackRestTestCommon_manifestLoad BackRestTestCommon_manifestSave);
BackRestTestCommon_manifestLoad BackRestTestCommon_manifestSave BackRestTestCommon_CommandMainAbsGet);
my $strPgSqlBin;
my $strCommonStanza;
@@ -276,7 +276,7 @@ sub BackRestTestCommon_ExecuteBegin
my $strBinPath = dirname(dirname(abs_path($0))) . '/bin';
$bFullLog = false;
if ($strCommandParam =~ /^$strBinPath\/pg_backrest\.pl/)
if ($strCommandParam =~ /\/bin\/pg_backrest\.pl/)
{
my $strTestPath = BackRestTestCommon_TestPathGet();
@@ -610,7 +610,7 @@ sub BackRestTestCommon_Setup
$strCommonDbCommonPath = "${strCommonTestPath}/db/common";
$strCommonDbTablespacePath = "${strCommonTestPath}/db/tablespace";
$strCommonCommandMain = "${strCommonBasePath}/bin/pg_backrest.pl";
$strCommonCommandMain = "../bin/pg_backrest.pl";
$strCommonCommandRemote = "${strCommonBasePath}/bin/pg_backrest_remote.pl";
$strCommonCommandPsql = "${strPgSqlBin}/psql -X %option% -h ${strCommonDbPath}";
@@ -999,6 +999,11 @@ sub BackRestTestCommon_CommandMainGet
return $strCommonCommandMain;
}
sub BackRestTestCommon_CommandMainAbsGet
{
return abs_path($strCommonCommandMain);
}
sub BackRestTestCommon_CommandRemoteGet
{
return $strCommonCommandRemote;