1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2026-05-22 10:15:16 +02:00

Simplify output in command/backup unit tests.

The output combined a representation of the files/paths/links in the manifest along with output of what was validated on disk. This was redundant and made maintenance of the tests difficult, especially with all the quoting in the manifest output (which also made it hard to search for output).

Instead use primarily the output created during validation and add fields from the manifest that were missing. Exclude paths from the output when there are files in the path since the path is then implied.

One major change here is that checksums are no longer output. This makes it easier to write tests that work on multiple architectures and all checksums are already verified during validation.
This commit is contained in:
David Steele
2024-01-24 14:54:28 -03:00
parent 1a0cc96c5a
commit 5ce8b9dfae
+199 -508
View File
@@ -26,8 +26,8 @@ Get a list of all files in the backup and a redacted version of the manifest tha
static String * static String *
testBackupValidateFile( testBackupValidateFile(
const Storage *const storage, const String *const path, Manifest *const manifest, const ManifestData *const manifestData, const Storage *const storage, const String *const path, Manifest *const manifest, const ManifestData *const manifestData,
const String *const fileName, uint64_t fileSize, ManifestFilePack **const filePack, const CipherType cipherType, const String *const fileName, uint64_t fileSize, ManifestFilePack **const filePack, const time_t backupTimeStart,
const String *const cipherPass) const CipherType cipherType, const String *const cipherPass)
{ {
FUNCTION_HARNESS_BEGIN(); FUNCTION_HARNESS_BEGIN();
FUNCTION_HARNESS_PARAM(STORAGE, storage); FUNCTION_HARNESS_PARAM(STORAGE, storage);
@@ -37,6 +37,7 @@ testBackupValidateFile(
FUNCTION_HARNESS_PARAM(STRING, fileName); FUNCTION_HARNESS_PARAM(STRING, fileName);
FUNCTION_HARNESS_PARAM(UINT64, fileSize); FUNCTION_HARNESS_PARAM(UINT64, fileSize);
FUNCTION_HARNESS_PARAM_P(VOID, filePack); FUNCTION_HARNESS_PARAM_P(VOID, filePack);
FUNCTION_HARNESS_PARAM(TIME, backupTimeStart);
FUNCTION_HARNESS_PARAM(STRING_ID, cipherType); FUNCTION_HARNESS_PARAM(STRING_ID, cipherType);
FUNCTION_HARNESS_PARAM(STRING, cipherPass); FUNCTION_HARNESS_PARAM(STRING, cipherPass);
FUNCTION_HARNESS_END(); FUNCTION_HARNESS_END();
@@ -44,10 +45,17 @@ testBackupValidateFile(
String *const result = strNew(); String *const result = strNew();
ManifestFile file = manifestFileUnpack(manifest, *filePack); ManifestFile file = manifestFileUnpack(manifest, *filePack);
// Output name and size
// -------------------------------------------------------------------------------------------------------------
if (file.bundleId != 0) if (file.bundleId != 0)
strCatFmt(result, "%s/%s {file", strZ(fileName), strZ(file.name)); strCatFmt(result, "%s/%s {", strZ(fileName), strZ(file.name));
else else
strCatFmt(result, "%s {file", strZ(fileName)); strCatFmt(result, "%s {", strZ(fileName));
strCatFmt(result, "s=%" PRIu64, file.size);
if (file.sizeOriginal != file.size)
strCatFmt(result, ", so=%" PRIu64, file.sizeOriginal);
// Validate repo checksum // Validate repo checksum
// ------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------
@@ -184,8 +192,6 @@ testBackupValidateFile(
if (!bufEq(checksum, BUF(file.checksumSha1, HASH_TYPE_SHA1_SIZE))) if (!bufEq(checksum, BUF(file.checksumSha1, HASH_TYPE_SHA1_SIZE)))
THROW_FMT(AssertError, "'%s' checksum does match manifest", strZ(file.name)); THROW_FMT(AssertError, "'%s' checksum does match manifest", strZ(file.name));
strCatFmt(result, ", s=%" PRIu64, size);
// Test size and repo-size // Test size and repo-size
// ------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------
if (size != file.size) if (size != file.size)
@@ -195,6 +201,32 @@ testBackupValidateFile(
if (file.bundleId == 0 && fileSize != file.sizeRepo) if (file.bundleId == 0 && fileSize != file.sizeRepo)
THROW_FMT(AssertError, "'%s' repo size does match manifest", strZ(file.name)); THROW_FMT(AssertError, "'%s' repo size does match manifest", strZ(file.name));
// Timestamp
// -------------------------------------------------------------------------------------------------------------
if (file.timestamp != backupTimeStart)
{
strCatFmt(
result, ", ts=%s%" PRId64, file.timestamp > backupTimeStart ? "+" : "",
(int64_t)file.timestamp - (int64_t)backupTimeStart);
}
// Page checksum
// -------------------------------------------------------------------------------------------------------------
if (file.checksumPage)
{
strCatZ(result, ", ckp=");
if (file.checksumPageError)
{
if (file.checksumPageErrorList != NULL)
strCat(result, file.checksumPageErrorList);
else
strCatZ(result, "t");
}
else
strCatZ(result, "t");
}
// pg_control and WAL headers have different checksums depending on cpu architecture so remove the checksum from // pg_control and WAL headers have different checksums depending on cpu architecture so remove the checksum from
// the test output. // the test output.
// ------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------
@@ -216,7 +248,8 @@ testBackupValidateFile(
static String * static String *
testBackupValidateList( testBackupValidateList(
const Storage *const storage, const String *const path, Manifest *const manifest, const ManifestData *const manifestData, const Storage *const storage, const String *const path, Manifest *const manifest, const ManifestData *const manifestData,
StringList *const manifestFileList, const CipherType cipherType, const String *const cipherPass, String *const result) StringList *const manifestFileList, const time_t backupTimeStart, const CipherType cipherType, const String *const cipherPass,
String *const result)
{ {
FUNCTION_HARNESS_BEGIN(); FUNCTION_HARNESS_BEGIN();
FUNCTION_HARNESS_PARAM(STORAGE, storage); FUNCTION_HARNESS_PARAM(STORAGE, storage);
@@ -224,6 +257,7 @@ testBackupValidateList(
FUNCTION_HARNESS_PARAM(MANIFEST, manifest); FUNCTION_HARNESS_PARAM(MANIFEST, manifest);
FUNCTION_HARNESS_PARAM_P(VOID, manifestData); FUNCTION_HARNESS_PARAM_P(VOID, manifestData);
FUNCTION_HARNESS_PARAM(STRING_LIST, manifestFileList); FUNCTION_HARNESS_PARAM(STRING_LIST, manifestFileList);
FUNCTION_HARNESS_PARAM(TIME, backupTimeStart);
FUNCTION_HARNESS_PARAM(STRING_ID, cipherType); FUNCTION_HARNESS_PARAM(STRING_ID, cipherType);
FUNCTION_HARNESS_PARAM(STRING, cipherPass); FUNCTION_HARNESS_PARAM(STRING, cipherPass);
FUNCTION_HARNESS_PARAM(STRING, result); FUNCTION_HARNESS_PARAM(STRING, result);
@@ -233,7 +267,7 @@ testBackupValidateList(
const StorageInfo dotInfo = storageInfoP(storage, path); const StorageInfo dotInfo = storageInfoP(storage, path);
if (dotInfo.type == storageTypeLink) if (dotInfo.type == storageTypeLink)
strCatFmt(result, ". {link, d=%s}\n", strZ(dotInfo.linkDestination)); strCatFmt(result, ".> {d=%s}\n", strZ(dotInfo.linkDestination));
// Output path contents // Output path contents
StorageIterator *const storageItr = storageNewItrP(storage, path, .recurse = true, .sortOrder = sortOrderAsc); StorageIterator *const storageItr = storageNewItrP(storage, path, .recurse = true, .sortOrder = sortOrderAsc);
@@ -317,19 +351,22 @@ testBackupValidateList(
strCat( strCat(
result, result,
testBackupValidateFile( testBackupValidateFile(
storage, path, manifest, manifestData, info.name, info.size, filePack, cipherType, cipherPass)); storage, path, manifest, manifestData, info.name, info.size, filePack, backupTimeStart, cipherType,
cipherPass));
} }
break; break;
} }
case storageTypeLink: case storageTypeLink:
strCatFmt(result, "%s {link, d=%s}\n", strZ(info.name), strZ(info.linkDestination)); strCatFmt(result, "%s> {d=%s}\n", strZ(info.name), strZ(info.linkDestination));
break; break;
case storageTypePath: case storageTypePath:
{ {
strCatFmt(result, "%s {path", strZ(info.name)); // Add path to output only when it is empty -- otherwise it is implied by the files below it
if (strLstEmpty(storageListP(storage, storagePathP(storage, strNewFmt("%s/%s", strZ(path), strZ(info.name))))))
strCatFmt(result, "%s/\n", strZ(info.name));
// Check against the manifest // Check against the manifest
// ----------------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------------
@@ -347,7 +384,6 @@ testBackupValidateList(
if (!strEq(info.group, TEST_GROUP_STR)) if (!strEq(info.group, TEST_GROUP_STR))
THROW_FMT(AssertError, "'%s' group should be '" TEST_GROUP "'", strZ(info.name)); THROW_FMT(AssertError, "'%s' group should be '" TEST_GROUP "'", strZ(info.name));
strCatZ(result, "}\n");
break; break;
} }
@@ -366,15 +402,17 @@ typedef struct TestBackupValidateParam
const char *cipherPass; // Cipher pass const char *cipherPass; // Cipher pass
} TestBackupValidateParam; } TestBackupValidateParam;
#define testBackupValidateP(storage, path, ...) \ #define testBackupValidateP(storage, path, ...) \
testBackupValidate(storage, path, (TestBackupValidateParam){VAR_PARAM_INIT, __VA_ARGS__}) testBackupValidate(storage, path, backupTimeStart, (TestBackupValidateParam){VAR_PARAM_INIT, __VA_ARGS__})
static String * static String *
testBackupValidate(const Storage *const storage, const String *const path, TestBackupValidateParam param) testBackupValidate(
const Storage *const storage, const String *const path, const time_t backupTimeStart, const TestBackupValidateParam param)
{ {
FUNCTION_HARNESS_BEGIN(); FUNCTION_HARNESS_BEGIN();
FUNCTION_HARNESS_PARAM(STORAGE, storage); FUNCTION_HARNESS_PARAM(STORAGE, storage);
FUNCTION_HARNESS_PARAM(STRING, path); FUNCTION_HARNESS_PARAM(STRING, path);
FUNCTION_HARNESS_PARAM(TIME, backupTimeStart);
FUNCTION_HARNESS_PARAM(UINT64, param.cipherType); FUNCTION_HARNESS_PARAM(UINT64, param.cipherType);
FUNCTION_HARNESS_PARAM(STRINGZ, param.cipherPass); FUNCTION_HARNESS_PARAM(STRINGZ, param.cipherPass);
FUNCTION_HARNESS_END(); FUNCTION_HARNESS_END();
@@ -405,7 +443,8 @@ testBackupValidate(const Storage *const storage, const String *const path, TestB
const CipherType cipherType = param.cipherType == 0 ? cipherTypeNone : param.cipherType; const CipherType cipherType = param.cipherType == 0 ? cipherTypeNone : param.cipherType;
const String *const cipherPass = param.cipherPass == NULL ? NULL : manifestCipherSubPass(manifest); const String *const cipherPass = param.cipherPass == NULL ? NULL : manifestCipherSubPass(manifest);
testBackupValidateList(storage, path, manifest, manifestData(manifest), manifestFileList, cipherType, cipherPass, result); testBackupValidateList(
storage, path, manifest, manifestData(manifest), manifestFileList, backupTimeStart, cipherType, cipherPass, result);
// Check remaining files in the manifest -- these should all be references // Check remaining files in the manifest -- these should all be references
for (unsigned int manifestFileIdx = 0; manifestFileIdx < strLstSize(manifestFileList); manifestFileIdx++) for (unsigned int manifestFileIdx = 0; manifestFileIdx < strLstSize(manifestFileList); manifestFileIdx++)
@@ -433,7 +472,7 @@ testBackupValidate(const Storage *const storage, const String *const path, TestB
.compressType = manifestData(manifest)->backupOptionCompressType, .compressType = manifestData(manifest)->backupOptionCompressType,
.blockIncr = file.blockIncrMapSize != 0), .blockIncr = file.blockIncrMapSize != 0),
sizeof(STORAGE_REPO_BACKUP)), sizeof(STORAGE_REPO_BACKUP)),
file.sizeRepo, filePack, cipherType, cipherPass)); file.sizeRepo, filePack, backupTimeStart, cipherType, cipherPass));
} }
// Make sure both backup.manifest files exist since we skipped them in the callback above // Make sure both backup.manifest files exist since we skipped them in the callback above
@@ -492,8 +531,11 @@ testBackupValidate(const Storage *const storage, const String *const path, TestB
strEqZ(section, MANIFEST_SECTION_BACKUP_DB) || strEqZ(section, MANIFEST_SECTION_BACKUP_DB) ||
strEqZ(section, MANIFEST_SECTION_BACKUP_OPTION) || strEqZ(section, MANIFEST_SECTION_BACKUP_OPTION) ||
strEqZ(section, MANIFEST_SECTION_DB) || strEqZ(section, MANIFEST_SECTION_DB) ||
strEqZ(section, MANIFEST_SECTION_TARGET_FILE) ||
strEqZ(section, MANIFEST_SECTION_TARGET_FILE_DEFAULT) || strEqZ(section, MANIFEST_SECTION_TARGET_FILE_DEFAULT) ||
strEqZ(section, MANIFEST_SECTION_TARGET_LINK) ||
strEqZ(section, MANIFEST_SECTION_TARGET_LINK_DEFAULT) || strEqZ(section, MANIFEST_SECTION_TARGET_LINK_DEFAULT) ||
strEqZ(section, MANIFEST_SECTION_TARGET_PATH) ||
strEqZ(section, MANIFEST_SECTION_TARGET_PATH_DEFAULT)) strEqZ(section, MANIFEST_SECTION_TARGET_PATH_DEFAULT))
{ {
bSkipSection = true; bSkipSection = true;
@@ -2153,28 +2195,14 @@ testRun(void)
TEST_RESULT_STR_Z( TEST_RESULT_STR_Z(
testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")), testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")),
". {link, d=20191002-070640F}\n" ".> {d=20191002-070640F}\n"
"pg_data {path}\n" "pg_data/PG_VERSION {s=3}\n"
"pg_data/PG_VERSION {file, s=3}\n" "pg_data/global/pg_control {s=8192}\n"
"pg_data/global {path}\n" "pg_data/pg_xlog/\n"
"pg_data/global/pg_control {file, s=8192}\n" "pg_data/postgresql.conf {s=11}\n"
"pg_data/pg_xlog {path}\n"
"pg_data/postgresql.conf {file, s=11}\n"
"--------\n" "--------\n"
"[backup:target]\n" "[backup:target]\n"
"pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n" "pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n",
"\n"
"[target:file]\n"
"pg_data/PG_VERSION={\"checksum\":\"06d06bb31b570b94d7b4325f511f853dbe771c21\",\"size\":3"
",\"timestamp\":1570000000}\n"
"pg_data/global/pg_control={\"size\":8192,\"timestamp\":1570000000}\n"
"pg_data/postgresql.conf={\"checksum\":\"e3db315c260e79211b7b52587123b7aa060f30ab\",\"size\":11"
",\"timestamp\":1570000000}\n"
"\n"
"[target:path]\n"
"pg_data={}\n"
"pg_data/global={}\n"
"pg_data/pg_xlog={}\n",
"compare file list"); "compare file list");
} }
@@ -2316,41 +2344,18 @@ testRun(void)
TEST_RESULT_STR_Z( TEST_RESULT_STR_Z(
testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")), testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")),
". {link, d=20191003-105320F}\n" ".> {d=20191003-105320F}\n"
"pg_data {path}\n" "pg_data/PG_VERSION.gz {s=3, ts=-100000}\n"
"pg_data/PG_VERSION.gz {file, s=3}\n" "pg_data/global/pg_control.gz {s=8192}\n"
"pg_data/global {path}\n" "pg_data/not-in-resume.gz {s=4}\n"
"pg_data/global/pg_control.gz {file, s=8192}\n" "pg_data/pg_xlog/0000000105D95D3000000000.gz {s=16777216, ts=+2}\n"
"pg_data/not-in-resume.gz {file, s=4}\n" "pg_data/postgresql.conf.gz {s=11, ts=-100000}\n"
"pg_data/pg_xlog {path}\n" "pg_data/size-mismatch.gz {s=4}\n"
"pg_data/pg_xlog/0000000105D95D3000000000.gz {file, s=16777216}\n" "pg_data/time-mismatch.gz {s=4}\n"
"pg_data/postgresql.conf.gz {file, s=11}\n" "pg_data/zero-size.gz {s=0}\n"
"pg_data/size-mismatch.gz {file, s=4}\n"
"pg_data/time-mismatch.gz {file, s=4}\n"
"pg_data/zero-size.gz {file, s=0}\n"
"--------\n" "--------\n"
"[backup:target]\n" "[backup:target]\n"
"pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n" "pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n",
"\n"
"[target:file]\n"
"pg_data/PG_VERSION={\"checksum\":\"06d06bb31b570b94d7b4325f511f853dbe771c21\",\"size\":3"
",\"timestamp\":1570000000}\n"
"pg_data/global/pg_control={\"size\":8192,\"timestamp\":1570100000}\n"
"pg_data/not-in-resume={\"checksum\":\"984816fd329622876e14907634264e6f332e9fb3\",\"size\":4"
",\"timestamp\":1570100000}\n"
"pg_data/pg_xlog/0000000105D95D3000000000={\"size\":16777216,\"timestamp\":1570100002}\n"
"pg_data/postgresql.conf={\"checksum\":\"e3db315c260e79211b7b52587123b7aa060f30ab\",\"size\":11"
",\"timestamp\":1570000000}\n"
"pg_data/size-mismatch={\"checksum\":\"984816fd329622876e14907634264e6f332e9fb3\",\"size\":4"
",\"timestamp\":1570100000}\n"
"pg_data/time-mismatch={\"checksum\":\"984816fd329622876e14907634264e6f332e9fb3\",\"size\":4"
",\"timestamp\":1570100000}\n"
"pg_data/zero-size={\"size\":0,\"timestamp\":1570100000}\n"
"\n"
"[target:path]\n"
"pg_data={}\n"
"pg_data/global={}\n"
"pg_data/pg_xlog={}\n",
"compare file list"); "compare file list");
// Remove test files // Remove test files
@@ -2509,39 +2514,18 @@ testRun(void)
// Check repo directory // Check repo directory
TEST_RESULT_STR_Z( TEST_RESULT_STR_Z(
testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")), testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")),
". {link, d=20191003-105320F_20191004-144000D}\n" ".> {d=20191003-105320F_20191004-144000D}\n"
"pg_data {path}\n" "pg_data/PG_VERSION.gz {s=3, ts=-200000}\n"
"pg_data/PG_VERSION.gz {file, s=3}\n" "pg_data/content-mismatch.gz {s=4}\n"
"pg_data/content-mismatch.gz {file, s=4}\n" "pg_data/global/pg_control.gz {s=8192}\n"
"pg_data/global {path}\n" "pg_data/pg_xlog/\n"
"pg_data/global/pg_control.gz {file, s=8192}\n" "pg_data/postgresql.conf.gz {s=11, ts=-200000}\n"
"pg_data/pg_xlog {path}\n" "pg_data/repo-size-mismatch.gz {s=4}\n"
"pg_data/postgresql.conf.gz {file, s=11}\n" "pg_data/resume-ref.gz {s=0}\n"
"pg_data/repo-size-mismatch.gz {file, s=4}\n" "pg_data/time-mismatch2.gz {s=4, ts=+100}\n"
"pg_data/resume-ref.gz {file, s=0}\n"
"pg_data/time-mismatch2.gz {file, s=4}\n"
"--------\n" "--------\n"
"[backup:target]\n" "[backup:target]\n"
"pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n" "pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n",
"\n"
"[target:file]\n"
"pg_data/PG_VERSION={\"checksum\":\"06d06bb31b570b94d7b4325f511f853dbe771c21\",\"reference\":\"20191003-105320F\""
",\"size\":3,\"timestamp\":1570000000}\n"
"pg_data/content-mismatch={\"checksum\":\"984816fd329622876e14907634264e6f332e9fb3\",\"size\":4"
",\"timestamp\":1570200000}\n"
"pg_data/global/pg_control={\"size\":8192,\"timestamp\":1570200000}\n"
"pg_data/postgresql.conf={\"checksum\":\"e3db315c260e79211b7b52587123b7aa060f30ab\""
",\"reference\":\"20191003-105320F\",\"size\":11,\"timestamp\":1570000000}\n"
"pg_data/repo-size-mismatch={\"checksum\":\"984816fd329622876e14907634264e6f332e9fb3\",\"size\":4"
",\"timestamp\":1570200000}\n"
"pg_data/resume-ref={\"size\":0,\"timestamp\":1570200000}\n"
"pg_data/time-mismatch2={\"checksum\":\"984816fd329622876e14907634264e6f332e9fb3\",\"size\":4"
",\"timestamp\":1570200100}\n"
"\n"
"[target:path]\n"
"pg_data={}\n"
"pg_data/global={}\n"
"pg_data/pg_xlog={}\n",
"compare file list"); "compare file list");
// Remove test files // Remove test files
@@ -2668,44 +2652,18 @@ testRun(void)
TEST_RESULT_STR_Z( TEST_RESULT_STR_Z(
testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")), testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")),
". {link, d=20191016-042640F}\n" ".> {d=20191016-042640F}\n"
"pg_data {path}\n" "pg_data/PG_VERSION {s=3}\n"
"pg_data/PG_VERSION {file, s=3}\n" "pg_data/backup_label {s=17, ts=+2}\n"
"pg_data/backup_label {file, s=17}\n" "pg_data/base/1/1 {s=0}\n"
"pg_data/base {path}\n" "pg_data/base/1/2 {s=2}\n"
"pg_data/base/1 {path}\n" "pg_data/base/1/3 {s=3, so=4}\n"
"pg_data/base/1/1 {file, s=0}\n" "pg_data/global/pg_control {s=8192}\n"
"pg_data/base/1/2 {file, s=2}\n" "pg_data/pg_xlog/0000000105DA69C000000000 {s=16777216, ts=+2}\n"
"pg_data/base/1/3 {file, s=3}\n" "pg_data/postgresql.conf {s=11, ts=-1200000}\n"
"pg_data/global {path}\n"
"pg_data/global/pg_control {file, s=8192}\n"
"pg_data/pg_xlog {path}\n"
"pg_data/pg_xlog/0000000105DA69C000000000 {file, s=16777216}\n"
"pg_data/postgresql.conf {file, s=11}\n"
"--------\n" "--------\n"
"[backup:target]\n" "[backup:target]\n"
"pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n" "pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n",
"\n"
"[target:file]\n"
"pg_data/PG_VERSION={\"checksum\":\"f5b7e6d36dc0113f61b36c700817d42b96f7b037\",\"size\":3"
",\"timestamp\":1571200000}\n"
"pg_data/backup_label={\"checksum\":\"8e6f41ac87a7514be96260d65bacbffb11be77dc\",\"size\":17"
",\"timestamp\":1571200002}\n"
"pg_data/base/1/1={\"size\":0,\"timestamp\":1571200000}\n"
"pg_data/base/1/2={\"checksum\":\"54ceb91256e8190e474aa752a6e0650a2df5ba37\",\"size\":2,\"timestamp\":1571200000}\n"
"pg_data/base/1/3={\"checksum\":\"3c01bdbb26f358bab27f267924aa2c9a03fcfdb8\",\"size\":3,\"szo\":4"
",\"timestamp\":1571200000}\n"
"pg_data/global/pg_control={\"size\":8192,\"timestamp\":1571200000}\n"
"pg_data/pg_xlog/0000000105DA69C000000000={\"size\":16777216,\"timestamp\":1571200002}\n"
"pg_data/postgresql.conf={\"checksum\":\"e3db315c260e79211b7b52587123b7aa060f30ab\",\"size\":11"
",\"timestamp\":1570000000}\n"
"\n"
"[target:path]\n"
"pg_data={}\n"
"pg_data/base={}\n"
"pg_data/base/1={}\n"
"pg_data/global={}\n"
"pg_data/pg_xlog={}\n",
"compare file list"); "compare file list");
// Remove test files // Remove test files
@@ -2777,7 +2735,6 @@ testRun(void)
*(PageHeaderData *)(bufPtr(relation) + (pgPageSize8 * 0x01)) = (PageHeaderData){.pd_upper = 0xFF}; *(PageHeaderData *)(bufPtr(relation) + (pgPageSize8 * 0x01)) = (PageHeaderData){.pd_upper = 0xFF};
HRN_STORAGE_PUT(storagePgWrite(), PG_PATH_BASE "/1/2", relation, .timeModified = backupTimeStart); HRN_STORAGE_PUT(storagePgWrite(), PG_PATH_BASE "/1/2", relation, .timeModified = backupTimeStart);
const char *rel1_2Sha1 = strZ(strNewEncode(encodingHex, cryptoHashOne(hashTypeSha1, relation)));
// File with bad page checksums // File with bad page checksums
relation = bufNew(pgPageSize8 * 5); relation = bufNew(pgPageSize8 * 5);
@@ -2791,7 +2748,6 @@ testRun(void)
bufUsedSet(relation, bufSize(relation)); bufUsedSet(relation, bufSize(relation));
HRN_STORAGE_PUT(storagePgWrite(), PG_PATH_BASE "/1/3", relation, .timeModified = backupTimeStart); HRN_STORAGE_PUT(storagePgWrite(), PG_PATH_BASE "/1/3", relation, .timeModified = backupTimeStart);
const char *rel1_3Sha1 = strZ(strNewEncode(encodingHex, cryptoHashOne(hashTypeSha1, relation)));
// File with bad page checksum // File with bad page checksum
relation = bufNew(pgPageSize8 * 3); relation = bufNew(pgPageSize8 * 3);
@@ -2804,7 +2760,6 @@ testRun(void)
bufUsedSet(relation, bufSize(relation)); bufUsedSet(relation, bufSize(relation));
HRN_STORAGE_PUT(storagePgWrite(), PG_PATH_BASE "/1/4", relation, .timeModified = backupTimeStart); HRN_STORAGE_PUT(storagePgWrite(), PG_PATH_BASE "/1/4", relation, .timeModified = backupTimeStart);
const char *rel1_4Sha1 = strZ(strNewEncode(encodingHex, cryptoHashOne(hashTypeSha1, relation)));
// Add a tablespace // Add a tablespace
HRN_STORAGE_PATH_CREATE(storagePgWrite(), PG_PATH_PGTBLSPC); HRN_STORAGE_PATH_CREATE(storagePgWrite(), PG_PATH_PGTBLSPC);
@@ -2858,75 +2813,27 @@ testRun(void)
"P00 INFO: new backup label = 20191027-181320F\n" "P00 INFO: new backup label = 20191027-181320F\n"
"P00 INFO: full backup size = [SIZE], file total = 13"); "P00 INFO: full backup size = [SIZE], file total = 13");
TEST_RESULT_STR( TEST_RESULT_STR_Z(
testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/20191027-181320F")), testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/20191027-181320F")),
strNewFmt( "pg_data/PG_VERSION.gz {s=2}\n"
"pg_data {path}\n" "pg_data/backup_label.gz {s=17, ts=+2}\n"
"pg_data/PG_VERSION.gz {file, s=2}\n" "pg_data/base/1/1.gz {s=16384, ckp=t}\n"
"pg_data/backup_label.gz {file, s=17}\n" "pg_data/base/1/2.gz {s=8704, ckp=t}\n"
"pg_data/base {path}\n" "pg_data/base/1/3.gz {s=40960, ckp=[0,[2,4]]}\n"
"pg_data/base/1 {path}\n" "pg_data/base/1/4.gz {s=24576, ckp=[1]}\n"
"pg_data/base/1/1.gz {file, s=16384}\n" "pg_data/global/pg_control.gz {s=8192}\n"
"pg_data/base/1/2.gz {file, s=8704}\n" "pg_data/pg_tblspc/\n"
"pg_data/base/1/3.gz {file, s=40960}\n" "pg_data/pg_wal/0000000105DB5DE000000000.gz {s=1048576, ts=+2}\n"
"pg_data/base/1/4.gz {file, s=24576}\n" "pg_data/pg_wal/0000000105DB5DE000000001.gz {s=1048576, ts=+2}\n"
"pg_data/global {path}\n" "pg_data/pg_wal/0000000105DB5DE000000002.gz {s=1048576, ts=+2}\n"
"pg_data/global/pg_control.gz {file, s=8192}\n" "pg_data/postgresql.conf.gz {s=11, ts=-2200000}\n"
"pg_data/pg_tblspc {path}\n" "pg_data/tablespace_map.gz {s=19, ts=+2}\n"
"pg_data/pg_wal {path}\n" "pg_tblspc/32768/PG_11_201809051/1/5.gz {s=0, ckp=t}\n"
"pg_data/pg_wal/0000000105DB5DE000000000.gz {file, s=1048576}\n" "--------\n"
"pg_data/pg_wal/0000000105DB5DE000000001.gz {file, s=1048576}\n" "[backup:target]\n"
"pg_data/pg_wal/0000000105DB5DE000000002.gz {file, s=1048576}\n" "pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n"
"pg_data/postgresql.conf.gz {file, s=11}\n" "pg_tblspc/32768={\"path\":\"../../pg1-tblspc/32768\",\"tablespace-id\":\"32768\""
"pg_data/tablespace_map.gz {file, s=19}\n" ",\"tablespace-name\":\"tblspc32768\",\"type\":\"link\"}\n",
"pg_tblspc {path}\n"
"pg_tblspc/32768 {path}\n"
"pg_tblspc/32768/PG_11_201809051 {path}\n"
"pg_tblspc/32768/PG_11_201809051/1 {path}\n"
"pg_tblspc/32768/PG_11_201809051/1/5.gz {file, s=0}\n"
"--------\n"
"[backup:target]\n"
"pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n"
"pg_tblspc/32768={\"path\":\"../../pg1-tblspc/32768\",\"tablespace-id\":\"32768\""
",\"tablespace-name\":\"tblspc32768\",\"type\":\"link\"}\n"
"\n"
"[target:file]\n"
"pg_data/PG_VERSION={\"checksum\":\"17ba0791499db908433b80f37c5fbc89b870084b\",\"size\":2"
",\"timestamp\":1572200000}\n"
"pg_data/backup_label={\"checksum\":\"8e6f41ac87a7514be96260d65bacbffb11be77dc\",\"size\":17"
",\"timestamp\":1572200002}\n"
"pg_data/base/1/1={\"checksum\":\"897256b6709e1a4da9daba92b6bde39ccfccd8c1\",\"checksum-page\":true"
",\"size\":16384,\"timestamp\":1572200000}\n"
"pg_data/base/1/2={\"checksum\":\"%s\",\"checksum-page\":false,\"size\":8704,\"timestamp\":1572200000}\n"
"pg_data/base/1/3={\"checksum\":\"%s\",\"checksum-page\":false,\"checksum-page-error\":[0,[2,4]]"
",\"size\":40960,\"timestamp\":1572200000}\n"
"pg_data/base/1/4={\"checksum\":\"%s\",\"checksum-page\":false,\"checksum-page-error\":[1],\"size\":24576"
",\"timestamp\":1572200000}\n"
"pg_data/global/pg_control={\"size\":8192,\"timestamp\":1572200000}\n"
"pg_data/pg_wal/0000000105DB5DE000000000={\"size\":1048576,\"timestamp\":1572200002}\n"
"pg_data/pg_wal/0000000105DB5DE000000001={\"size\":1048576,\"timestamp\":1572200002}\n"
"pg_data/pg_wal/0000000105DB5DE000000002={\"size\":1048576,\"timestamp\":1572200002}\n"
"pg_data/postgresql.conf={\"checksum\":\"e3db315c260e79211b7b52587123b7aa060f30ab\",\"size\":11"
",\"timestamp\":1570000000}\n"
"pg_data/tablespace_map={\"checksum\":\"87fe624d7976c2144e10afcb7a9a49b071f35e9c\",\"size\":19"
",\"timestamp\":1572200002}\n"
"pg_tblspc/32768/PG_11_201809051/1/5={\"checksum-page\":true,\"size\":0,\"timestamp\":1572200000}\n"
"\n"
"[target:link]\n"
"pg_data/pg_tblspc/32768={\"destination\":\"../../pg1-tblspc/32768\"}\n"
"\n"
"[target:path]\n"
"pg_data={}\n"
"pg_data/base={}\n"
"pg_data/base/1={}\n"
"pg_data/global={}\n"
"pg_data/pg_tblspc={}\n"
"pg_data/pg_wal={}\n"
"pg_tblspc={}\n"
"pg_tblspc/32768={}\n"
"pg_tblspc/32768/PG_11_201809051={}\n"
"pg_tblspc/32768/PG_11_201809051/1={}\n",
rel1_2Sha1, rel1_3Sha1, rel1_4Sha1),
"compare file list"); "compare file list");
// Remove test files // Remove test files
@@ -3007,7 +2914,6 @@ testRun(void)
bufUsedSet(relation, bufSize(relation)); bufUsedSet(relation, bufSize(relation));
HRN_STORAGE_PUT(storagePgWrite(), PG_PATH_BASE "/1/3", relation, .timeModified = backupTimeStart); HRN_STORAGE_PUT(storagePgWrite(), PG_PATH_BASE "/1/3", relation, .timeModified = backupTimeStart);
const char *rel1_3Sha1 = strZ(strNewEncode(encodingHex, cryptoHashOne(hashTypeSha1, relation)));
// File will be truncated during backup to show that actual file size is copied no matter what original size is. This // File will be truncated during backup to show that actual file size is copied no matter what original size is. This
// will also cause an alignment error. // will also cause an alignment error.
@@ -3048,67 +2954,24 @@ testRun(void)
"P00 INFO: new backup label = 20191027-181320F_20191030-014640I\n" "P00 INFO: new backup label = 20191027-181320F_20191030-014640I\n"
"P00 INFO: incr backup size = [SIZE], file total = 8"); "P00 INFO: incr backup size = [SIZE], file total = 8");
TEST_RESULT_STR( TEST_RESULT_STR_Z(
testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")), testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")),
strNewFmt( ".> {d=20191027-181320F_20191030-014640I}\n"
". {link, d=20191027-181320F_20191030-014640I}\n" "pg_data/PG_VERSION.gz {s=2, ts=-200000}\n"
"pg_data {path}\n" "pg_data/backup_label.gz {s=17, ts=+2}\n"
"pg_data/PG_VERSION.gz {file, s=2}\n" "pg_data/base/1/1.gz {s=8207, so=16384, ts=-200000, ckp=t}\n"
"pg_data/backup_label.gz {file, s=17}\n" "pg_data/base/1/3.gz {s=32768, ckp=[0,3]}\n"
"pg_data/base {path}\n" "pg_data/global/pg_control.gz {s=8192}\n"
"pg_data/base/1 {path}\n" "pg_data/pg_tblspc/32768> {d=../../pg_tblspc/32768}\n"
"pg_data/base/1/1.gz {file, s=8207}\n" "pg_data/pg_wal/\n"
"pg_data/base/1/3.gz {file, s=32768}\n" "pg_data/postgresql.conf.gz {s=11, ts=-2400000}\n"
"pg_data/global {path}\n" "pg_data/tablespace_map.gz {s=19, ts=+2}\n"
"pg_data/global/pg_control.gz {file, s=8192}\n" "pg_tblspc/32768/PG_11_201809051/1/5.gz {s=0, ts=-200000, ckp=t}\n"
"pg_data/pg_tblspc {path}\n" "--------\n"
"pg_data/pg_tblspc/32768 {link, d=../../pg_tblspc/32768}\n" "[backup:target]\n"
"pg_data/pg_wal {path}\n" "pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n"
"pg_data/postgresql.conf.gz {file, s=11}\n" "pg_tblspc/32768={\"path\":\"../../pg1-tblspc/32768\",\"tablespace-id\":\"32768\""
"pg_data/tablespace_map.gz {file, s=19}\n" ",\"tablespace-name\":\"tblspc32768\",\"type\":\"link\"}\n",
"pg_tblspc {path}\n"
"pg_tblspc/32768 {path}\n"
"pg_tblspc/32768/PG_11_201809051 {path}\n"
"pg_tblspc/32768/PG_11_201809051/1 {path}\n"
"pg_tblspc/32768/PG_11_201809051/1/5.gz {file, s=0}\n"
"--------\n"
"[backup:target]\n"
"pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n"
"pg_tblspc/32768={\"path\":\"../../pg1-tblspc/32768\",\"tablespace-id\":\"32768\""
",\"tablespace-name\":\"tblspc32768\",\"type\":\"link\"}\n"
"\n"
"[target:file]\n"
"pg_data/PG_VERSION={\"checksum\":\"17ba0791499db908433b80f37c5fbc89b870084b\""
",\"reference\":\"20191027-181320F\",\"size\":2,\"timestamp\":1572200000}\n"
"pg_data/backup_label={\"checksum\":\"8e6f41ac87a7514be96260d65bacbffb11be77dc\",\"size\":17"
",\"timestamp\":1572400002}\n"
"pg_data/base/1/1={\"checksum\":\"6f21554107c79a423c4a45a5c8f946162baa93ff\",\"checksum-page\":false"
",\"size\":8207,\"szo\":16384,\"timestamp\":1572200000}\n"
"pg_data/base/1/3={\"checksum\":\"%s\",\"checksum-page\":false,\"checksum-page-error\":[0,3],\"size\":32768"
",\"timestamp\":1572400000}\n"
"pg_data/global/pg_control={\"size\":8192,\"timestamp\":1572400000}\n"
"pg_data/postgresql.conf={\"checksum\":\"e3db315c260e79211b7b52587123b7aa060f30ab\""
",\"reference\":\"20191027-181320F\",\"size\":11,\"timestamp\":1570000000}\n"
"pg_data/tablespace_map={\"checksum\":\"87fe624d7976c2144e10afcb7a9a49b071f35e9c\",\"size\":19"
",\"timestamp\":1572400002}\n"
"pg_tblspc/32768/PG_11_201809051/1/5={\"checksum-page\":true,\"reference\":\"20191027-181320F\",\"size\":0"
",\"timestamp\":1572200000}\n"
"\n"
"[target:link]\n"
"pg_data/pg_tblspc/32768={\"destination\":\"../../pg1-tblspc/32768\"}\n"
"\n"
"[target:path]\n"
"pg_data={}\n"
"pg_data/base={}\n"
"pg_data/base/1={}\n"
"pg_data/global={}\n"
"pg_data/pg_tblspc={}\n"
"pg_data/pg_wal={}\n"
"pg_tblspc={}\n"
"pg_tblspc/32768={}\n"
"pg_tblspc/32768/PG_11_201809051={}\n"
"pg_tblspc/32768/PG_11_201809051/1={}\n",
rel1_3Sha1),
"compare file list"); "compare file list");
// Remove test files // Remove test files
@@ -3202,24 +3065,19 @@ testRun(void)
TEST_RESULT_STR_Z( TEST_RESULT_STR_Z(
testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")), testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")),
". {link, d=20191030-014640F}\n" ".> {d=20191030-014640F}\n"
"bundle {path}\n" "bundle/1/pg_data/PG_VERSION {s=2, ts=-200000}\n"
"bundle/1/pg_data/PG_VERSION {file, s=2}\n" "bundle/1/pg_data/postgresql.auto.conf {s=12, ts=-72400000}\n"
"bundle/1/pg_data/postgresql.auto.conf {file, s=12}\n" "bundle/1/pg_data/postgresql.conf {s=11, ts=-2400000}\n"
"bundle/1/pg_data/postgresql.conf {file, s=11}\n" "bundle/1/pg_data/stuff.conf {s=12, ts=-72400000}\n"
"bundle/1/pg_data/stuff.conf {file, s=12}\n" "bundle/2/pg_data/bigish.dat {s=8191, ts=-72399999}\n"
"bundle/2/pg_data/bigish.dat {file, s=8191}\n" "bundle/3/pg_data/global/pg_control {s=8192}\n"
"bundle/3/pg_data/global/pg_control {file, s=8192}\n" "pg_data/backup_label.gz {s=17, ts=+2}\n"
"pg_data {path}\n" "pg_data/base/1/1.gz {s=8207, ckp=t}\n"
"pg_data/backup_label.gz {file, s=17}\n" "pg_data/base/1/2.gz {s=24576, ckp=t}\n"
"pg_data/base {path}\n" "pg_data/pg_wal/0000000105DB8EB000000000.gz {s=1048576, ts=+2}\n"
"pg_data/base/1 {path}\n" "pg_data/pg_wal/0000000105DB8EB000000001.gz {s=1048576, ts=+2}\n"
"pg_data/base/1/1.gz {file, s=8207}\n" "pg_data/tablespace_map.gz {s=19, ts=+2}\n"
"pg_data/base/1/2.gz {file, s=24576}\n"
"pg_data/pg_wal {path}\n"
"pg_data/pg_wal/0000000105DB8EB000000000.gz {file, s=1048576}\n"
"pg_data/pg_wal/0000000105DB8EB000000001.gz {file, s=1048576}\n"
"pg_data/tablespace_map.gz {file, s=19}\n"
"--------\n" "--------\n"
"[backup:target]\n" "[backup:target]\n"
"pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n" "pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n"
@@ -3227,47 +3085,7 @@ testRun(void)
",\"tablespace-name\":\"tblspc32768\",\"type\":\"link\"}\n" ",\"tablespace-name\":\"tblspc32768\",\"type\":\"link\"}\n"
"\n" "\n"
"[metadata]\n" "[metadata]\n"
"annotation={\"extra key\":\"this is an annotation\",\"source\":\"this is another annotation\"}\n" "annotation={\"extra key\":\"this is an annotation\",\"source\":\"this is another annotation\"}\n",
"\n"
"[target:file]\n"
"pg_data/PG_VERSION={\"checksum\":\"17ba0791499db908433b80f37c5fbc89b870084b\",\"size\":2"
",\"timestamp\":1572200000}\n"
"pg_data/backup_label={\"checksum\":\"8e6f41ac87a7514be96260d65bacbffb11be77dc\",\"size\":17"
",\"timestamp\":1572400002}\n"
"pg_data/base/1/1={\"checksum\":\"6f21554107c79a423c4a45a5c8f946162baa93ff\",\"checksum-page\":false,\"size\":8207"
",\"timestamp\":1572400000}\n"
"pg_data/base/1/2={\"checksum\":\"ebdd38b69cd5b9f2d00d273c981e16960fbbb4f7\",\"checksum-page\":true,\"size\":24576"
",\"timestamp\":1572400000}\n"
"pg_data/bigish.dat={\"checksum\":\"3e5175386be683d2f231f3fa3eab892a799082f7\",\"size\":8191"
",\"timestamp\":1500000001}\n"
"pg_data/global/pg_control={\"size\":8192,\"timestamp\":1572400000}\n"
"pg_data/pg_wal/0000000105DB8EB000000000={\"size\":1048576,\"timestamp\":1572400002}\n"
"pg_data/pg_wal/0000000105DB8EB000000001={\"size\":1048576,\"timestamp\":1572400002}\n"
"pg_data/postgresql.auto.conf={\"checksum\":\"e873a5cb5a67e48761e7b619c531311404facdce\",\"size\":12"
",\"timestamp\":1500000000}\n"
"pg_data/postgresql.conf={\"checksum\":\"e3db315c260e79211b7b52587123b7aa060f30ab\",\"size\":11"
",\"timestamp\":1570000000}\n"
"pg_data/stuff.conf={\"checksum\":\"55a9d0d18b77789c7722abe72aa905e2dc85bb5d\",\"size\":12"
",\"timestamp\":1500000000}\n"
"pg_data/tablespace_map={\"checksum\":\"87fe624d7976c2144e10afcb7a9a49b071f35e9c\",\"size\":19"
",\"timestamp\":1572400002}\n"
"pg_data/zero={\"size\":0,\"timestamp\":1572400000}\n"
"pg_tblspc/32768/PG_11_201809051/1/5={\"checksum-page\":true,\"size\":0,\"timestamp\":1572200000}\n"
"\n"
"[target:link]\n"
"pg_data/pg_tblspc/32768={\"destination\":\"../../pg1-tblspc/32768\"}\n"
"\n"
"[target:path]\n"
"pg_data={}\n"
"pg_data/base={}\n"
"pg_data/base/1={}\n"
"pg_data/global={}\n"
"pg_data/pg_tblspc={}\n"
"pg_data/pg_wal={}\n"
"pg_tblspc={}\n"
"pg_tblspc/32768={}\n"
"pg_tblspc/32768/PG_11_201809051={}\n"
"pg_tblspc/32768/PG_11_201809051/1={}\n",
"compare file list"); "compare file list");
} }
@@ -3325,27 +3143,13 @@ testRun(void)
TEST_RESULT_STR_Z( TEST_RESULT_STR_Z(
testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")), testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")),
". {link, d=20191030-014640F_20191101-092000D}\n" ".> {d=20191030-014640F_20191101-092000D}\n"
"bundle {path}\n" "bundle/1/pg_data/global/pg_control {s=8192}\n"
"bundle/1/pg_data/global/pg_control {file, s=8192}\n" "pg_data/backup_label.gz {s=17, ts=+2}\n"
"pg_data {path}\n" "20191030-014640F/bundle/1/pg_data/PG_VERSION {s=2}\n"
"pg_data/backup_label.gz {file, s=17}\n"
"20191030-014640F/bundle/1/pg_data/PG_VERSION {file, s=2}\n"
"--------\n" "--------\n"
"[backup:target]\n" "[backup:target]\n"
"pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n" "pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n",
"\n"
"[target:file]\n"
"pg_data/PG_VERSION={\"checksum\":\"17ba0791499db908433b80f37c5fbc89b870084b\",\"reference\":\"20191030-014640F\""
",\"size\":2,\"timestamp\":1572600000}\n"
"pg_data/backup_label={\"checksum\":\"8e6f41ac87a7514be96260d65bacbffb11be77dc\",\"size\":17"
",\"timestamp\":1572600002}\n"
"pg_data/global/pg_control={\"size\":8192,\"timestamp\":1572600000}\n"
"pg_data/zero={\"size\":0,\"timestamp\":1572600000}\n"
"\n"
"[target:path]\n"
"pg_data={}\n"
"pg_data/global={}\n",
"compare file list"); "compare file list");
} }
@@ -3479,47 +3283,20 @@ testRun(void)
TEST_RESULT_STR_Z( TEST_RESULT_STR_Z(
testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")), testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")),
". {link, d=20191103-165320F}\n" ".> {d=20191103-165320F}\n"
"bundle {path}\n" "bundle/1/pg_data/PG_VERSION {s=2}\n"
"bundle/1/pg_data/PG_VERSION {file, s=2}\n" "bundle/1/pg_data/block-incr-same {s=16384, m=0:{0,1}}\n"
"bundle/1/pg_data/block-incr-same {file, m=0:{0,1}, s=16384}\n" "bundle/1/pg_data/block-incr-shrink {s=16385, m=0:{0,1,2}}\n"
"bundle/1/pg_data/block-incr-shrink {file, m=0:{0,1,2}, s=16385}\n" "bundle/1/pg_data/block-incr-shrink-below {s=16384, m=0:{0,1}}\n"
"bundle/1/pg_data/block-incr-shrink-below {file, m=0:{0,1}, s=16384}\n" "bundle/1/pg_data/block-incr-shrink-block {s=16384, m=0:{0,1}}\n"
"bundle/1/pg_data/block-incr-shrink-block {file, m=0:{0,1}, s=16384}\n" "bundle/1/pg_data/global/pg_control {s=8192}\n"
"bundle/1/pg_data/global/pg_control {file, s=8192}\n" "bundle/1/pg_data/grow-to-block-incr {s=16383}\n"
"bundle/1/pg_data/grow-to-block-incr {file, s=16383}\n" "bundle/1/pg_data/normal-same {s=4}\n"
"bundle/1/pg_data/normal-same {file, s=4}\n" "pg_data/backup_label {s=17, ts=+2}\n"
"pg_data {path}\n" "pg_data/block-incr-grow.pgbi {s=24576, m=0:{0,1,2}}\n"
"pg_data/backup_label {file, s=17}\n"
"pg_data/block-incr-grow.pgbi {file, m=0:{0,1,2}, s=24576}\n"
"--------\n" "--------\n"
"[backup:target]\n" "[backup:target]\n"
"pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n" "pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n",
"\n"
"[target:file]\n"
"pg_data/PG_VERSION={\"checksum\":\"17ba0791499db908433b80f37c5fbc89b870084b\",\"size\":2"
",\"timestamp\":1572800000}\n"
"pg_data/backup_label={\"checksum\":\"8e6f41ac87a7514be96260d65bacbffb11be77dc\",\"size\":17"
",\"timestamp\":1572800002}\n"
"pg_data/block-incr-grow={\"bi\":1,\"bim\":24,\"checksum\":\"ebdd38b69cd5b9f2d00d273c981e16960fbbb4f7\""
",\"size\":24576,\"timestamp\":1572800000}\n"
"pg_data/block-incr-same={\"bi\":1,\"bim\":22,\"checksum\":\"5d389611c12c8b8d2c28d4e590799c016b9375be\""
",\"size\":16384,\"timestamp\":1572800000}\n"
"pg_data/block-incr-shrink={\"bi\":1,\"bim\":29,\"checksum\":\"ce5f8864058b1bb274244b512cb9641355987134\""
",\"size\":16385,\"timestamp\":1572800000}\n"
"pg_data/block-incr-shrink-below={\"bi\":1,\"bim\":22,\"checksum\":\"eb6b081c4abb3bd08edbc5945c9b3ce969088538\""
",\"size\":16384,\"timestamp\":1572800000}\n"
"pg_data/block-incr-shrink-block={\"bi\":1,\"bim\":22,\"checksum\":\"d6a2f1f82878bbcbe1697f89c2aa5ede4e945efc\","
"\"size\":16384,\"timestamp\":1572800000}\n"
"pg_data/global/pg_control={\"size\":8192,\"timestamp\":1572800000}\n"
"pg_data/grow-to-block-incr={\"checksum\":\"f5a5c308cf5fcb52bccebe2365f8ed56acbcc41d\",\"size\":16383"
",\"timestamp\":1572800000}\n"
"pg_data/normal-same={\"checksum\":\"64b404a01e9e34e74c7509b3ab6adfe63e79d31c\",\"size\":4"
",\"timestamp\":1572800000}\n"
"\n"
"[target:path]\n"
"pg_data={}\n"
"pg_data/global={}\n",
"compare file list"); "compare file list");
} }
@@ -3629,51 +3406,21 @@ testRun(void)
TEST_RESULT_STR_Z( TEST_RESULT_STR_Z(
testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")), testBackupValidateP(storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest")),
". {link, d=20191103-165320F_20191106-002640D}\n" ".> {d=20191103-165320F_20191106-002640D}\n"
"bundle {path}\n" "bundle/1/pg_data/block-incr-same {s=16384, m=0:{0,1}}\n"
"bundle/1/pg_data/block-incr-same {file, m=0:{0,1}, s=16384}\n" "bundle/1/pg_data/block-incr-shrink {s=16383, m=0:{0},1:{0}}\n"
"bundle/1/pg_data/block-incr-shrink {file, m=0:{0},1:{0}, s=16383}\n" "bundle/1/pg_data/block-incr-shrink-below {s=8}\n"
"bundle/1/pg_data/block-incr-shrink-below {file, s=8}\n" "bundle/1/pg_data/block-incr-shrink-block {s=8192, m=0:{0}}\n"
"bundle/1/pg_data/block-incr-shrink-block {file, m=0:{0}, s=8192}\n" "bundle/1/pg_data/global/pg_control {s=8192}\n"
"bundle/1/pg_data/global/pg_control {file, s=8192}\n" "bundle/1/pg_data/grow-to-block-incr {s=16385, m=1:{0,1,2}}\n"
"bundle/1/pg_data/grow-to-block-incr {file, m=1:{0,1,2}, s=16385}\n" "bundle/1/pg_data/normal-same {s=4}\n"
"bundle/1/pg_data/normal-same {file, s=4}\n" "pg_data/backup_label {s=17, ts=+2}\n"
"pg_data {path}\n" "pg_data/block-incr-grow.pgbi {s=131072, m=0:{0},1:{0},0:{2},1:{1,2,3,4,5,6,7,8,9,10,11,12,13}}\n"
"pg_data/backup_label {file, s=17}\n" "pg_data/block-incr-larger.pgbi {s=1507328, m=1:{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15},1:{0,1,2,3,4,5,6}}\n"
"pg_data/block-incr-grow.pgbi {file, m=0:{0},1:{0},0:{2},1:{1,2,3,4,5,6,7,8,9,10,11,12,13}, s=131072}\n" "20191103-165320F/bundle/1/pg_data/PG_VERSION {s=2, ts=-200000}\n"
"pg_data/block-incr-larger.pgbi {file, m=1:{0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15},1:{0,1,2,3,4,5,6}, s=1507328}\n"
"20191103-165320F/bundle/1/pg_data/PG_VERSION {file, s=2}\n"
"--------\n" "--------\n"
"[backup:target]\n" "[backup:target]\n"
"pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n" "pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n",
"\n"
"[target:file]\n"
"pg_data/PG_VERSION={\"checksum\":\"17ba0791499db908433b80f37c5fbc89b870084b\",\"reference\":\"20191103-165320F\""
",\"size\":2,\"timestamp\":1572800000}\n"
"pg_data/backup_label={\"checksum\":\"8e6f41ac87a7514be96260d65bacbffb11be77dc\",\"size\":17"
",\"timestamp\":1573000002}\n"
"pg_data/block-incr-grow={\"bi\":1,\"bim\":114,\"checksum\":\"1ddde8db92dd9019be0819ae4f9ad9cea2fae399\""
",\"size\":131072,\"timestamp\":1573000000}\n"
"pg_data/block-incr-larger={\"bi\":8,\"bic\":7,\"bim\":173"
",\"checksum\":\"eec53a6da79c00b3c658a7e09f44b3e9efefd960\",\"size\":1507328,\"timestamp\":1573000000}\n"
"pg_data/block-incr-same={\"bi\":1,\"bim\":22,\"checksum\":\"5d389611c12c8b8d2c28d4e590799c016b9375be\""
",\"size\":16384,\"timestamp\":1573000000}\n"
"pg_data/block-incr-shrink={\"bi\":1,\"bim\":35,\"checksum\":\"1c6a17f67562d8b3f64f1b5f2ee592a4c2809b3b\""
",\"size\":16383,\"timestamp\":1573000000}\n"
"pg_data/block-incr-shrink-below={\"checksum\":\"12fe190b16c245bd5c971e574352e43e4e703edc\",\"size\":8"
",\"timestamp\":1573000000}\n"
"pg_data/block-incr-shrink-block={\"bi\":1,\"bim\":17,\"checksum\":\"b659cdc8436b0632a448ccf7492dfb5b2d366991\","
"\"size\":8192,\"timestamp\":1573000000}\n"
"pg_data/global/pg_control={\"size\":8192,\"timestamp\":1573000000}\n"
"pg_data/grow-to-block-incr={\"bi\":1,\"bim\":27,\"checksum\":\"4f560611d9dc9212432970e5c4bec15d876c226e\","
"\"size\":16385,\"timestamp\":1573000000}\n"
"pg_data/normal-same={\"checksum\":\"64b404a01e9e34e74c7509b3ab6adfe63e79d31c\",\"size\":4"
",\"timestamp\":1573000000}\n"
"pg_data/truncate-to-zero={\"size\":0,\"szo\":4,\"timestamp\":1573000000}\n"
"\n"
"[target:path]\n"
"pg_data={}\n"
"pg_data/global={}\n",
"compare file list"); "compare file list");
HRN_STORAGE_REMOVE(storagePgWrite(), "block-incr-grow"); HRN_STORAGE_REMOVE(storagePgWrite(), "block-incr-grow");
@@ -3766,32 +3513,15 @@ testRun(void)
testBackupValidateP( testBackupValidateP(
storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest"), .cipherType = cipherTypeAes256Cbc, storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest"), .cipherType = cipherTypeAes256Cbc,
.cipherPass = TEST_CIPHER_PASS), .cipherPass = TEST_CIPHER_PASS),
". {link, d=20191108-080000F}\n" ".> {d=20191108-080000F}\n"
"bundle {path}\n" "bundle/1/pg_data/PG_VERSION {s=2, ts=-400000}\n"
"bundle/1/pg_data/PG_VERSION {file, s=2}\n" "bundle/1/pg_data/global/pg_control {s=8192}\n"
"bundle/1/pg_data/global/pg_control {file, s=8192}\n" "pg_data/backup_label.gz {s=17, ts=+2}\n"
"pg_data {path}\n" "pg_data/block-incr-grow.pgbi {s=24576, m=0:{0,1,2}}\n"
"pg_data/backup_label.gz {file, s=17}\n" "pg_data/block-incr-wayback.pgbi {s=16384, m=0:{0,1}}\n"
"pg_data/block-incr-grow.pgbi {file, m=0:{0,1,2}, s=24576}\n"
"pg_data/block-incr-wayback.pgbi {file, m=0:{0,1}, s=16384}\n"
"--------\n" "--------\n"
"[backup:target]\n" "[backup:target]\n"
"pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n" "pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n",
"\n"
"[target:file]\n"
"pg_data/PG_VERSION={\"checksum\":\"17ba0791499db908433b80f37c5fbc89b870084b\",\"size\":2"
",\"timestamp\":1572800000}\n"
"pg_data/backup_label={\"checksum\":\"8e6f41ac87a7514be96260d65bacbffb11be77dc\",\"size\":17"
",\"timestamp\":1573200002}\n"
"pg_data/block-incr-grow={\"bi\":1,\"bim\":40,\"checksum\":\"ebdd38b69cd5b9f2d00d273c981e16960fbbb4f7\","
"\"size\":24576,\"timestamp\":1573200000}\n"
"pg_data/block-incr-wayback={\"bi\":1,\"bim\":40,\"checksum\":\"897256b6709e1a4da9daba92b6bde39ccfccd8c1\""
",\"size\":16384,\"timestamp\":1573200000}\n"
"pg_data/global/pg_control={\"size\":8192,\"timestamp\":1573200000}\n"
"\n"
"[target:path]\n"
"pg_data={}\n"
"pg_data/global={}\n",
"compare file list"); "compare file list");
} }
@@ -3875,38 +3605,17 @@ testRun(void)
testBackupValidateP( testBackupValidateP(
storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest"), .cipherType = cipherTypeAes256Cbc, storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest"), .cipherType = cipherTypeAes256Cbc,
.cipherPass = TEST_CIPHER_PASS), .cipherPass = TEST_CIPHER_PASS),
". {link, d=20191108-080000F_20191110-153320D}\n" ".> {d=20191108-080000F_20191110-153320D}\n"
"bundle {path}\n" "bundle/1/pg_data/block-age-multiplier {s=32768, m=1:{0,1}, ts=-86400}\n"
"bundle/1/pg_data/block-age-multiplier {file, m=1:{0,1}, s=32768}\n" "bundle/1/pg_data/block-age-to-zero {s=16384, ts=-172800}\n"
"bundle/1/pg_data/block-age-to-zero {file, s=16384}\n" "bundle/1/pg_data/block-incr-grow {s=49152, m=0:{0,1},1:{0,1,2,3}}\n"
"bundle/1/pg_data/block-incr-grow {file, m=0:{0,1},1:{0,1,2,3}, s=49152}\n" "bundle/1/pg_data/global/pg_control {s=8192}\n"
"bundle/1/pg_data/global/pg_control {file, s=8192}\n" "pg_data/backup_label.gz {s=17, ts=+2}\n"
"pg_data {path}\n" "20191108-080000F/bundle/1/pg_data/PG_VERSION {s=2, ts=-600000}\n"
"pg_data/backup_label.gz {file, s=17}\n" "20191108-080000F/pg_data/block-incr-wayback.pgbi {s=16384, m=0:{0,1}, ts=-172800}\n"
"20191108-080000F/bundle/1/pg_data/PG_VERSION {file, s=2}\n"
"20191108-080000F/pg_data/block-incr-wayback.pgbi {file, m=0:{0,1}, s=16384}\n"
"--------\n" "--------\n"
"[backup:target]\n" "[backup:target]\n"
"pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n" "pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n",
"\n"
"[target:file]\n"
"pg_data/PG_VERSION={\"checksum\":\"17ba0791499db908433b80f37c5fbc89b870084b\",\"reference\":\"20191108-080000F\""
",\"size\":2,\"timestamp\":1572800000}\n"
"pg_data/backup_label={\"checksum\":\"8e6f41ac87a7514be96260d65bacbffb11be77dc\",\"size\":17"
",\"timestamp\":1573400002}\n"
"pg_data/block-age-multiplier={\"bi\":2,\"bic\":16,\"bim\":56"
",\"checksum\":\"5188431849b4613152fd7bdba6a3ff0a4fd6424b\",\"size\":32768,\"timestamp\":1573313600}\n"
"pg_data/block-age-to-zero={\"checksum\":\"897256b6709e1a4da9daba92b6bde39ccfccd8c1\",\"size\":16384,"
"\"timestamp\":1573227200}\n"
"pg_data/block-incr-grow={\"bi\":1,\"bim\":72,\"checksum\":\"bd4716c88f38d2540e3024b54308b0b95f34a0cc\""
",\"size\":49152,\"timestamp\":1573400000}\n"
"pg_data/block-incr-wayback={\"bi\":1,\"bim\":40,\"checksum\":\"897256b6709e1a4da9daba92b6bde39ccfccd8c1\","
"\"reference\":\"20191108-080000F\",\"size\":16384,\"timestamp\":1573227200}\n"
"pg_data/global/pg_control={\"size\":8192,\"timestamp\":1573400000}\n"
"\n"
"[target:path]\n"
"pg_data={}\n"
"pg_data/global={}\n",
"compare file list"); "compare file list");
} }
@@ -3985,33 +3694,15 @@ testRun(void)
testBackupValidateP( testBackupValidateP(
storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest"), .cipherType = cipherTypeAes256Cbc, storageRepo(), STRDEF(STORAGE_REPO_BACKUP "/latest"), .cipherType = cipherTypeAes256Cbc,
.cipherPass = TEST_CIPHER_PASS), .cipherPass = TEST_CIPHER_PASS),
". {link, d=20191111-192000F}\n" ".> {d=20191111-192000F}\n"
"bundle {path}\n" "bundle/1/pg_data/PG_VERSION {s=2}\n"
"bundle/1/pg_data/PG_VERSION {file, s=2}\n" "bundle/1/pg_data/global/pg_control {s=8192}\n"
"bundle/1/pg_data/global/pg_control {file, s=8192}\n" "pg_data/backup_label {s=17, ts=+2}\n"
"pg_data {path}\n" "pg_data/global/1 {s=12288, ckp=t}\n"
"pg_data/backup_label {file, s=17}\n" "pg_data/global/2 {s=16384, ckp=[3]}\n"
"pg_data/global {path}\n"
"pg_data/global/1 {file, s=12288}\n"
"pg_data/global/2 {file, s=16384}\n"
"--------\n" "--------\n"
"[backup:target]\n" "[backup:target]\n"
"pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n" "pg_data={\"path\":\"" TEST_PATH "/pg1\",\"type\":\"path\"}\n",
"\n"
"[target:file]\n"
"pg_data/PG_VERSION={\"checksum\":\"17ba0791499db908433b80f37c5fbc89b870084b\",\"repo-size\":32,\"size\":2"
",\"timestamp\":1573500000}\n"
"pg_data/backup_label={\"checksum\":\"8e6f41ac87a7514be96260d65bacbffb11be77dc\",\"repo-size\":48,\"size\":17"
",\"timestamp\":1573500002}\n"
"pg_data/global/1={\"checksum\":\"7cb41fea50720b48be0c145e1473982b23e9ab77\",\"checksum-page\":true"
",\"repo-size\":12320,\"size\":12288,\"timestamp\":1573500000}\n"
"pg_data/global/2={\"checksum\":\"02af87d042262a0313120317db0c285b3210209f\",\"checksum-page\":false"
",\"checksum-page-error\":[3],\"repo-size\":16416,\"size\":16384,\"timestamp\":1573500000}\n"
"pg_data/global/pg_control={\"repo-size\":8224,\"size\":8192,\"timestamp\":1573500000}\n"
"\n"
"[target:path]\n"
"pg_data={}\n"
"pg_data/global={}\n",
"compare file list"); "compare file list");
} }
} }