1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-03 00:26:59 +02:00

Restore with base path remap working.

This commit is contained in:
David Steele
2015-01-22 19:04:55 -05:00
parent 82969eb497
commit df4b50b977
4 changed files with 119 additions and 48 deletions

View File

@ -29,7 +29,7 @@ our @EXPORT = qw(BackRestTestCommon_Setup BackRestTestCommon_ExecuteBegin BackRe
BackRestTestCommon_Execute BackRestTestCommon_ExecuteBackRest
BackRestTestCommon_PathCreate BackRestTestCommon_PathMode BackRestTestCommon_PathRemove
BackRestTestCommon_FileCreate BackRestTestCommon_FileRemove BackRestTestCommon_PathCopy BackRestTestCommon_PathMove
BackRestTestCommon_ConfigCreate BackRestTestCommon_Run BackRestTestCommon_Cleanup
BackRestTestCommon_ConfigCreate BackRestTestCommon_ConfigRemap BackRestTestCommon_Run BackRestTestCommon_Cleanup
BackRestTestCommon_PgSqlBinPathGet BackRestTestCommon_StanzaGet BackRestTestCommon_CommandMainGet
BackRestTestCommon_CommandRemoteGet BackRestTestCommon_HostGet BackRestTestCommon_UserGet
BackRestTestCommon_GroupGet BackRestTestCommon_UserBackRestGet BackRestTestCommon_TestPathGet
@ -410,6 +410,42 @@ sub BackRestTestCommon_Setup
$bNoCleanup = $bNoCleanupParam;
}
####################################################################################################################################
# BackRestTestCommon_ConfigRemap
####################################################################################################################################
sub BackRestTestCommon_ConfigRemap
{
my $oRemapHashRef = shift;
my $oManifestRef = shift;
# Create config filename
my $strConfigFile = BackRestTestCommon_DbPathGet() . '/pg_backrest.conf';
my $strStanza = BackRestTestCommon_StanzaGet();
# Load Config file
my %oConfig;
ini_load($strConfigFile, \%oConfig);
# Rewrite remap section
delete($oConfig{"${strStanza}:tablespace:map"});
foreach my $strRemap (sort(keys $oRemapHashRef))
{
if ($strRemap eq 'base')
{
$oConfig{$strStanza}{path} = ${$oRemapHashRef}{$strRemap};
${$oManifestRef}{'backup:path'}{base} = ${$oRemapHashRef}{$strRemap};
}
else
{
confess " not coded yet";
}
}
# Resave the config file
ini_save($strConfigFile, \%oConfig);
}
####################################################################################################################################
# BackRestTestCommon_ConfigCreate
####################################################################################################################################