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

Implemented issue #109: Move VERSION into source code.

Also stopped replacing FORMAT number which explains the large number of test log changes.  FORMAT should change very rarely and cause test log failures when it does.
This commit is contained in:
David Steele
2015-06-22 13:11:07 -04:00
parent af58016871
commit f210fe99c3
37 changed files with 408 additions and 423 deletions

View File

@@ -1072,7 +1072,7 @@ sub BackRestTestBackup_BackupCompare
$oActualManifest{&MANIFEST_SECTION_BACKUP}{&MANIFEST_KEY_TIMESTAMP_COPY_START};
${$oExpectedManifestRef}{&INI_SECTION_BACKREST}{&INI_KEY_CHECKSUM} =
$oActualManifest{&INI_SECTION_BACKREST}{&INI_KEY_CHECKSUM};
${$oExpectedManifestRef}{&INI_SECTION_BACKREST}{&INI_KEY_FORMAT} = FORMAT + 0;
${$oExpectedManifestRef}{&INI_SECTION_BACKREST}{&INI_KEY_FORMAT} = BACKREST_FORMAT + 0;
my $strTestPath = BackRestTestCommon_TestPathGet();
@@ -2158,7 +2158,7 @@ sub BackRestTestBackup_Test
# Build the manifest
my %oManifest;
$oManifest{&INI_SECTION_BACKREST}{&INI_KEY_VERSION} = version_get();
$oManifest{&INI_SECTION_BACKREST}{&INI_KEY_VERSION} = BACKREST_VERSION;
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_ARCHIVE_CHECK} = JSON::PP::true;
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_ARCHIVE_COPY} = JSON::PP::true;
$oManifest{&MANIFEST_SECTION_BACKUP_OPTION}{&MANIFEST_KEY_COMPRESS} = $bCompress ? JSON::PP::true : JSON::PP::false;
@@ -2418,7 +2418,8 @@ sub BackRestTestBackup_Test
undef, undef, undef, undef, undef, undef,
'fail on mismatch format', ERROR_FORMAT);
BackRestTestBackup_ManifestMunge($oFile, $bRemote, $strBackup, INI_SECTION_BACKREST, INI_KEY_FORMAT, undef, FORMAT);
BackRestTestBackup_ManifestMunge($oFile, $bRemote, $strBackup, INI_SECTION_BACKREST, INI_KEY_FORMAT, undef,
BACKREST_FORMAT);
# Remap the base path
my %oRemapHash;

View File

@@ -445,18 +445,12 @@ sub BackRestTestCommon_ExecuteRegAll
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'USER', 'user = [^ \n,\[\]]+', '[^ \n,\[\]]+$');
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'USER', 'user"[ ]{0,1}:[ ]{0,1}"[^"]+', '[^"]+$');
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'VERSION', 'version[ ]{0,1}=[ ]{0,1}\"' . version_get(), version_get . '$');
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'VERSION', '"version"[ ]{0,1}:[ ]{0,1}\"' . version_get(), version_get . '$');
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'FORMAT', 'format=' . FORMAT, FORMAT . '$');
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'FORMAT', '"format"[ ]{0,1}:[ ]{0,1}' . FORMAT, FORMAT . '$');
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'PORT', '--port=[0-9]+', '[0-9]+$');
my $strTimestampRegExp = "[0-9]{4}-[0-1][0-9]-[0-3][0-9] [0-2][0-9]:[0-6][0-9]:[0-6][0-9]";
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'VERSION',
"version[\"]{0,1}[ ]{0,1}[\:\=)]{1}[ ]{0,1}[\"]{0,1}" . version_get(), version_get() . '$');
"version[\"]{0,1}[ ]{0,1}[\:\=)]{1}[ ]{0,1}[\"]{0,1}" . BACKREST_VERSION, BACKREST_VERSION . '$');
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'TIMESTAMP',
"timestamp-[a-z-]+[\"]{0,1}[ ]{0,1}[\:\=)]{1}[ ]{0,1}[\"]{0,1}[0-9]+", '[0-9]+$', false);
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'TIMESTAMP',