1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-06-02 22:57:34 +02:00

Backup unit tests are working.

This commit is contained in:
David Steele 2014-10-19 11:46:01 -04:00
parent 1d43c63326
commit 4de1d9aa5a
2 changed files with 19 additions and 3 deletions

View File

@ -1302,7 +1302,7 @@ sub backup_file_thread
{
# Generate the checksum
my $strChecksum = $oFileThread->hash(PATH_BACKUP_TMP,
$oFileCopyMap{$strFile}{backup_file} . ($bCompress ? '.gz' : ''));
$oFileCopyMap{$strFile}{backup_file} . ($bCompress ? '.gz' : ''), $bCompress);
# Write the checksum message into the master queue
$oMasterQueue[$iThreadIdx]->enqueue("checksum|$oFileCopyMap{$strFile}{file_section}|$oFileCopyMap{$strFile}{file}|${strChecksum}");

View File

@ -348,8 +348,8 @@ sub BackRestTestBackup_CompareBackup
my %oActualManifest;
config_load($oFile->path_get(PATH_BACKUP_CLUSTER, $strBackup) . '/backup.manifest', \%oActualManifest);
$oActualManifest{backup}{'timestamp-start'} = undef;
$oActualManifest{backup}{'timestamp-stop'} = undef;
${$oExpectedManifestRef}{backup}{'timestamp-start'} = $oActualManifest{backup}{'timestamp-start'};
${$oExpectedManifestRef}{backup}{'timestamp-stop'} = $oActualManifest{backup}{'timestamp-stop'};
my $strTestPath = BackRestTestCommon_TestPathGet();
@ -797,6 +797,22 @@ sub BackRestTestBackup_Test
$strBackup = BackRestTestBackup_LastBackup($oFile);
BackRestTestBackup_CompareBackup($oFile, $bRemote, BackRestTestBackup_LastBackup($oFile), \%oManifest);
# Perform second incr backup
BackRestTestBackup_ManifestReference(\%oManifest, $strBackup);
$strType = 'incr';
&log(INFO, " ${strType} backup (add files)");
BackRestTestBackup_ManifestFileCreate(\%oManifest, 'base', 'base/base2.txt', 'BASE2',
$bChecksum ? '09b5e31766be1dba1ec27de82f975c1b6eea2a92' : undef, $lTime);
BackRestTestCommon_Execute("${strCommand} --type=${strType}", $bRemote);
$oManifest{backup}{type} = $strType;
$strBackup = BackRestTestBackup_LastBackup($oFile);
BackRestTestBackup_CompareBackup($oFile, $bRemote, BackRestTestBackup_LastBackup($oFile), \%oManifest);
}
}
}