1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-07 00:35:37 +02:00

Replace defines with string constants in unit tests.

For tests already updated as part of the macro-replacement effort, the output tests (TEST_ERROR, TEST_RESULT_LOG, TEST_STORAGE_LIST and TEST_RESULT_STR) have been simplified for readability to remove all but the TEST_PATH constants. The ongoing macro-replacement effort will include these changes.

Updated: expireTest, stanzaTest, checkTest, infoTest, verifyTest (infoArchive and infoBackup had no changes).
This commit is contained in:
Cynthia Shang
2021-06-28 10:58:27 -04:00
committed by GitHub
parent fb2d111dcd
commit 065a8c8454
6 changed files with 162 additions and 193 deletions

View File

@ -74,6 +74,9 @@
<commit subject="Update info/infoBackup test to use standard patterns."> <commit subject="Update info/infoBackup test to use standard patterns.">
<github-pull-request id="1437"/> <github-pull-request id="1437"/>
</commit> </commit>
<commit subject="Replace defines with string constants in unit tests.">
<github-pull-request id="1440"/>
</commit>
<release-item-contributor-list> <release-item-contributor-list>
<release-item-contributor id="cynthia.shang"/> <release-item-contributor id="cynthia.shang"/>

View File

@ -112,8 +112,7 @@ testRun(void)
// Only confirming we get passed the check for repoIsLocal || more than one pg-path configured // Only confirming we get passed the check for repoIsLocal || more than one pg-path configured
TEST_ERROR( TEST_ERROR(
cmdCheck(), FileMissingError, "unable to open missing file '" TEST_PATH_PG "/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL cmdCheck(), FileMissingError, "unable to open missing file '" TEST_PATH_PG "/global/pg_control' for read");
"' for read");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("backup-standby set without standby"); TEST_TITLE("backup-standby set without standby");
@ -135,9 +134,8 @@ testRun(void)
}); });
TEST_ERROR( TEST_ERROR(
cmdCheck(), FileMissingError, "unable to open missing file '" TEST_PATH_PG "/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL cmdCheck(), FileMissingError, "unable to open missing file '" TEST_PATH_PG "/global/pg_control' for read");
"' for read"); TEST_RESULT_LOG("P00 WARN: option 'backup-standby' is enabled but standby is not properly configured");
TEST_RESULT_LOG("P00 WARN: option '" CFGOPT_BACKUP_STANDBY "' is enabled but standby is not properly configured");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("standby and primary database - standby path doesn't match pg_control"); TEST_TITLE("standby and primary database - standby path doesn't match pg_control");
@ -171,7 +169,7 @@ testRun(void)
TEST_ERROR( TEST_ERROR(
cmdCheck(), DbMismatchError, cmdCheck(), DbMismatchError,
"version '" PG_VERSION_92_STR "' and path '" TEST_PATH "' queried from cluster do not match version '" PG_VERSION_92_STR "version '" PG_VERSION_92_STR "' and path '" TEST_PATH "' queried from cluster do not match version '" PG_VERSION_92_STR
"' and '" TEST_PATH_PG "' read from '" TEST_PATH_PG "/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL "'\n" "' and '" TEST_PATH_PG "' read from '" TEST_PATH_PG "/global/pg_control'\n"
"HINT: the pg1-path and pg1-port settings likely reference different clusters."); "HINT: the pg1-path and pg1-port settings likely reference different clusters.");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
@ -426,7 +424,7 @@ testRun(void)
TEST_ERROR( TEST_ERROR(
checkDbConfig(PG_VERSION_94, db.primaryIdx, db.primary, false), DbMismatchError, checkDbConfig(PG_VERSION_94, db.primaryIdx, db.primary, false), DbMismatchError,
"version '" PG_VERSION_92_STR "' and path '" TEST_PATH_PG "' queried from cluster do not match version '" "version '" PG_VERSION_92_STR "' and path '" TEST_PATH_PG "' queried from cluster do not match version '"
PG_VERSION_94_STR "' and '" TEST_PATH_PG "' read from '" TEST_PATH_PG "/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL "'\n" PG_VERSION_94_STR "' and '" TEST_PATH_PG "' read from '" TEST_PATH_PG "/global/pg_control'\n"
"HINT: the pg1-path and pg1-port settings likely reference different clusters."); "HINT: the pg1-path and pg1-port settings likely reference different clusters.");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
@ -435,7 +433,7 @@ testRun(void)
TEST_ERROR_FMT( TEST_ERROR_FMT(
checkDbConfig(PG_VERSION_92, db.standbyIdx, db.standby, true), DbMismatchError, checkDbConfig(PG_VERSION_92, db.standbyIdx, db.standby, true), DbMismatchError,
"version '" PG_VERSION_92_STR "' and path '%s' queried from cluster do not match version '" PG_VERSION_92_STR "' and" "version '" PG_VERSION_92_STR "' and path '%s' queried from cluster do not match version '" PG_VERSION_92_STR "' and"
" '" TEST_PATH "/pg8' read from '" TEST_PATH "/pg8/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL "'\n" " '" TEST_PATH "/pg8' read from '" TEST_PATH "/pg8/global/pg_control'\n"
"HINT: the pg8-path and pg8-port settings likely reference different clusters.", "HINT: the pg8-path and pg8-port settings likely reference different clusters.",
strZ(dbPgDataPath(db.standby))); strZ(dbPgDataPath(db.standby)));

View File

@ -901,24 +901,21 @@ testRun(void)
TEST_ERROR( TEST_ERROR(
cmdExpire(), CommandError, CFGCMD_EXPIRE " command encountered 2 error(s), check the log file for details"); cmdExpire(), CommandError, CFGCMD_EXPIRE " command encountered 2 error(s), check the log file for details");
TEST_RESULT_LOG( TEST_RESULT_LOG(
"P00 ERROR: [055]: [DRY-RUN] repo1: unable to load info file '" TEST_PATH_REPO "/backup/db/" INFO_BACKUP_FILE "' or '" "P00 ERROR: [055]: [DRY-RUN] repo1: unable to load info file '" TEST_PATH_REPO "/backup/db/backup.info' or '"
TEST_PATH_REPO "/backup/db/" INFO_BACKUP_FILE INFO_COPY_EXT"':\n" TEST_PATH_REPO "/backup/db/backup.info.copy':\n"
" FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/db/" INFO_BACKUP_FILE " FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/db/backup.info' for read\n"
"' for read\n" " FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/db/backup.info.copy' for read\n"
" FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/db/" INFO_BACKUP_FILE
INFO_COPY_EXT "' for read\n"
" HINT: backup.info cannot be opened and is required to perform a backup.\n" " HINT: backup.info cannot be opened and is required to perform a backup.\n"
" HINT: has a stanza-create been performed?\n" " HINT: has a stanza-create been performed?\n"
"P00 INFO: [DRY-RUN] repo2: expire diff backup set 20181119-152800F_20181119-152152D," "P00 INFO: [DRY-RUN] repo2: expire diff backup set 20181119-152800F_20181119-152152D,"
" 20181119-152800F_20181119-152155I\n" " 20181119-152800F_20181119-152155I\n"
"P00 INFO: [DRY-RUN] repo2: remove expired backup 20181119-152800F_20181119-152155I\n" "P00 INFO: [DRY-RUN] repo2: remove expired backup 20181119-152800F_20181119-152155I\n"
"P00 INFO: [DRY-RUN] repo2: remove expired backup 20181119-152800F_20181119-152152D\n" "P00 INFO: [DRY-RUN] repo2: remove expired backup 20181119-152800F_20181119-152152D\n"
"P00 ERROR: [055]: [DRY-RUN] repo2: unable to load info file '" TEST_PATH "/repo2/archive/db/" INFO_ARCHIVE_FILE "P00 ERROR: [055]: [DRY-RUN] repo2: unable to load info file '" TEST_PATH "/repo2/archive/db/archive.info' or '"
"' or '" TEST_PATH "/repo2/archive/db/" INFO_ARCHIVE_FILE INFO_COPY_EXT "':\n" TEST_PATH "/repo2/archive/db/archive.info.copy':\n"
" FileMissingError: unable to open missing file '" TEST_PATH "/repo2/archive/db/" INFO_ARCHIVE_FILE " FileMissingError: unable to open missing file '" TEST_PATH "/repo2/archive/db/archive.info' for read\n"
"' for read\n" " FileMissingError: unable to open missing file '" TEST_PATH "/repo2/archive/db/archive.info.copy'"
" FileMissingError: unable to open missing file '" TEST_PATH "/repo2/archive/db/" INFO_ARCHIVE_FILE " for read\n"
INFO_COPY_EXT "' for read\n"
" HINT: archive.info cannot be opened but is required to push/get WAL segments.\n" " HINT: archive.info cannot be opened but is required to push/get WAL segments.\n"
" HINT: is archive_command configured correctly in postgresql.conf?\n" " HINT: is archive_command configured correctly in postgresql.conf?\n"
" HINT: has a stanza-create been performed?\n" " HINT: has a stanza-create been performed?\n"
@ -934,12 +931,10 @@ testRun(void)
TEST_ERROR( TEST_ERROR(
cmdExpire(), CommandError, CFGCMD_EXPIRE " command encountered 1 error(s), check the log file for details"); cmdExpire(), CommandError, CFGCMD_EXPIRE " command encountered 1 error(s), check the log file for details");
TEST_RESULT_LOG( TEST_RESULT_LOG(
"P00 ERROR: [055]: [DRY-RUN] repo1: unable to load info file '" TEST_PATH_REPO "/backup/db/" INFO_BACKUP_FILE "' or '" "P00 ERROR: [055]: [DRY-RUN] repo1: unable to load info file '" TEST_PATH_REPO "/backup/db/backup.info' or '"
TEST_PATH_REPO "/backup/db/" INFO_BACKUP_FILE INFO_COPY_EXT"':\n" TEST_PATH_REPO "/backup/db/backup.info.copy':\n"
" FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/db/" INFO_BACKUP_FILE " FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/db/backup.info' for read\n"
"' for read\n" " FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/db/backup.info.copy' for read\n"
" FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/db/" INFO_BACKUP_FILE
INFO_COPY_EXT "' for read\n"
" HINT: backup.info cannot be opened and is required to perform a backup.\n" " HINT: backup.info cannot be opened and is required to perform a backup.\n"
" HINT: has a stanza-create been performed?\n" " HINT: has a stanza-create been performed?\n"
"P00 INFO: [DRY-RUN] repo2: expire diff backup set 20181119-152800F_20181119-152152D," "P00 INFO: [DRY-RUN] repo2: expire diff backup set 20181119-152800F_20181119-152152D,"
@ -1879,17 +1874,17 @@ testRun(void)
TEST_STORAGE_LIST( TEST_STORAGE_LIST(
storageRepo(), STORAGE_REPO_BACKUP, storageRepo(), STORAGE_REPO_BACKUP,
"20181119-152138F/\n" "20181119-152138F/\n"
"20181119-152138F/" BACKUP_MANIFEST_FILE "\n" "20181119-152138F/backup.manifest\n"
"20181119-152800F/\n" "20181119-152800F/\n"
"20181119-152800F/" BACKUP_MANIFEST_FILE "\n" "20181119-152800F/backup.manifest\n"
"20181119-152800F_20181119-152252D/\n" "20181119-152800F_20181119-152252D/\n"
"20181119-152800F_20181119-152252D/" BACKUP_MANIFEST_FILE "\n" "20181119-152800F_20181119-152252D/backup.manifest\n"
"20181119-152850F/\n" "20181119-152850F/\n"
"20181119-152850F/" BACKUP_MANIFEST_FILE "\n" "20181119-152850F/backup.manifest\n"
"20181119-152900F/\n" "20181119-152900F/\n"
"20181119-152900F/" BACKUP_MANIFEST_FILE "\n" "20181119-152900F/backup.manifest\n"
"20181119-152900F_20181119-153000I/\n" "20181119-152900F_20181119-153000I/\n"
"20181119-152900F_20181119-153000I/" BACKUP_MANIFEST_FILE INFO_COPY_EXT "\n" "20181119-152900F_20181119-153000I/backup.manifest.copy\n"
"backup.info\n" "backup.info\n"
"backup.info.copy\n" "backup.info.copy\n"
"latest>\n", "latest>\n",
@ -1922,15 +1917,15 @@ testRun(void)
TEST_STORAGE_LIST( TEST_STORAGE_LIST(
storageRepo(), STORAGE_REPO_BACKUP, storageRepo(), STORAGE_REPO_BACKUP,
"20181119-152800F/\n" "20181119-152800F/\n"
"20181119-152800F/" BACKUP_MANIFEST_FILE "\n" "20181119-152800F/backup.manifest\n"
"20181119-152800F_20181119-152252D/\n" "20181119-152800F_20181119-152252D/\n"
"20181119-152800F_20181119-152252D/" BACKUP_MANIFEST_FILE "\n" "20181119-152800F_20181119-152252D/backup.manifest\n"
"20181119-152850F/\n" "20181119-152850F/\n"
"20181119-152850F/" BACKUP_MANIFEST_FILE "\n" "20181119-152850F/backup.manifest\n"
"20181119-152900F/\n" "20181119-152900F/\n"
"20181119-152900F/" BACKUP_MANIFEST_FILE "\n" "20181119-152900F/backup.manifest\n"
"20181119-152900F_20181119-153000I/\n" "20181119-152900F_20181119-153000I/\n"
"20181119-152900F_20181119-153000I/" BACKUP_MANIFEST_FILE INFO_COPY_EXT "\n" "20181119-152900F_20181119-153000I/backup.manifest.copy\n"
"backup.info\n" "backup.info\n"
"backup.info.copy\n" "backup.info.copy\n"
"latest>\n", "latest>\n",
@ -1957,11 +1952,11 @@ testRun(void)
TEST_STORAGE_LIST( TEST_STORAGE_LIST(
storageRepo(), STORAGE_REPO_BACKUP, storageRepo(), STORAGE_REPO_BACKUP,
"20181119-152800F/\n" "20181119-152800F/\n"
"20181119-152800F/" BACKUP_MANIFEST_FILE "\n" "20181119-152800F/backup.manifest\n"
"20181119-152800F_20181119-152252D/\n" "20181119-152800F_20181119-152252D/\n"
"20181119-152800F_20181119-152252D/" BACKUP_MANIFEST_FILE "\n" "20181119-152800F_20181119-152252D/backup.manifest\n"
"20181119-152850F/\n" "20181119-152850F/\n"
"20181119-152850F/" BACKUP_MANIFEST_FILE "\n" "20181119-152850F/backup.manifest\n"
"backup.info\n" "backup.info\n"
"backup.info.copy\n" "backup.info.copy\n"
"latest>\n", "latest>\n",
@ -2011,7 +2006,7 @@ testRun(void)
TEST_STORAGE_LIST( TEST_STORAGE_LIST(
storageRepo(), STORAGE_REPO_BACKUP, storageRepo(), STORAGE_REPO_BACKUP,
"20181119-152850F/\n" "20181119-152850F/\n"
"20181119-152850F/" BACKUP_MANIFEST_FILE "\n" "20181119-152850F/backup.manifest\n"
"backup.info\n" "backup.info\n"
"backup.info.copy\n" "backup.info.copy\n"
"latest>\n", "latest>\n",
@ -2149,10 +2144,7 @@ testRun(void)
storageRepoWrite(), INFO_BACKUP_PATH_FILE, storageRepoWrite(), INFO_BACKUP_PATH_FILE,
TEST_BACKUP_CURRENT TEST_BACKUP_CURRENT
TEST_BACKUP_DB); TEST_BACKUP_DB);
HRN_INFO_PUT( HRN_STORAGE_COPY(storageRepo(), INFO_BACKUP_PATH_FILE, storageRepoWrite(), INFO_BACKUP_PATH_FILE INFO_COPY_EXT);
storageRepoWrite(), INFO_BACKUP_PATH_FILE INFO_COPY_EXT,
TEST_BACKUP_CURRENT
TEST_BACKUP_DB);
// Adhoc backup and resumable backup manifests // Adhoc backup and resumable backup manifests
const String *manifestContent = STRDEF( const String *manifestContent = STRDEF(
@ -2239,9 +2231,6 @@ testRun(void)
TEST_BACKUP_DB); TEST_BACKUP_DB);
HRN_INFO_PUT(storageRepoIdxWrite(1), INFO_BACKUP_PATH_FILE, strZ(backupInfoContent), .cipherType = cipherTypeAes256Cbc); HRN_INFO_PUT(storageRepoIdxWrite(1), INFO_BACKUP_PATH_FILE, strZ(backupInfoContent), .cipherType = cipherTypeAes256Cbc);
HRN_INFO_PUT(
storageRepoIdxWrite(1), INFO_BACKUP_PATH_FILE INFO_COPY_EXT, strZ(backupInfoContent),
.cipherType = cipherTypeAes256Cbc);
HRN_INFO_PUT( HRN_INFO_PUT(
storageRepoIdxWrite(1), STORAGE_REPO_BACKUP "/20181119-152850F/" BACKUP_MANIFEST_FILE, storageRepoIdxWrite(1), STORAGE_REPO_BACKUP "/20181119-152850F/" BACKUP_MANIFEST_FILE,
"[backup]\nbackup-type=\"full\"\n", .cipherType = cipherTypeAes256Cbc, .cipherPass = "somepass"); "[backup]\nbackup-type=\"full\"\n", .cipherType = cipherTypeAes256Cbc, .cipherPass = "somepass");
@ -2250,7 +2239,7 @@ testRun(void)
"[backup]\nbackup-type=\"diff\"\n", .cipherType = cipherTypeAes256Cbc, .cipherPass = "somepass"); "[backup]\nbackup-type=\"diff\"\n", .cipherType = cipherTypeAes256Cbc, .cipherPass = "somepass");
HRN_INFO_PUT( HRN_INFO_PUT(
storageRepoIdxWrite(1), STORAGE_REPO_BACKUP "/20181119-152850F_20181200-152252D/" BACKUP_MANIFEST_FILE INFO_COPY_EXT, storageRepoIdxWrite(1), STORAGE_REPO_BACKUP "/20181119-152850F_20181200-152252D/" BACKUP_MANIFEST_FILE INFO_COPY_EXT,
strZ(manifestContent), .cipherType = cipherTypeAes256Cbc, .cipherPass = "somepass"); strZ(manifestContent), .cipherType = cipherTypeAes256Cbc, .cipherPass = "somepass", .comment = "resumable backup");
// archives to repo2 // archives to repo2
archiveGenerate(storageRepoIdxWrite(1), STORAGE_REPO_ARCHIVE, 2, 10, "12-2", "0000000100000000"); archiveGenerate(storageRepoIdxWrite(1), STORAGE_REPO_ARCHIVE, 2, 10, "12-2", "0000000100000000");

View File

@ -162,12 +162,12 @@ testRun(void)
"\"status\":{" "\"status\":{"
"\"code\":99," "\"code\":99,"
"\"message\":\"[FileMissingError] unable to load info file '" "\"message\":\"[FileMissingError] unable to load info file '"
TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "/stanza1/" INFO_ARCHIVE_FILE "' or '" TEST_PATH_REPO "/archive/stanza1/archive.info' or '"
TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "/stanza1/" INFO_ARCHIVE_FILE INFO_COPY_EXT "':\\n" TEST_PATH_REPO "/archive/stanza1/archive.info.copy':\\n"
"FileMissingError: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "FileMissingError: unable to open missing file '" TEST_PATH_REPO "/archive/stanza1/archive.info'"
"/stanza1/" INFO_ARCHIVE_FILE "' for read\\n" " for read\\n"
"FileMissingError: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "FileMissingError: unable to open missing file '" TEST_PATH_REPO
"/stanza1/" INFO_ARCHIVE_FILE INFO_COPY_EXT "' for read\\n" "/archive/stanza1/archive.info.copy' for read\\n"
"HINT: archive.info cannot be opened but is required to push/get WAL segments.\\n" "HINT: archive.info cannot be opened but is required to push/get WAL segments.\\n"
"HINT: is archive_command configured correctly in postgresql.conf?\\n" "HINT: is archive_command configured correctly in postgresql.conf?\\n"
"HINT: has a stanza-create been performed?\\n" "HINT: has a stanza-create been performed?\\n"
@ -190,13 +190,11 @@ testRun(void)
infoRender(), infoRender(),
"stanza: stanza1\n" "stanza: stanza1\n"
" status: error (other)\n" " status: error (other)\n"
" [FileMissingError] unable to load info file '" TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "/stanza1/" " [FileMissingError] unable to load info file '" TEST_PATH_REPO "/archive/stanza1/archive.info' or '"
INFO_ARCHIVE_FILE "' or '" TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "/stanza1/" INFO_ARCHIVE_FILE TEST_PATH_REPO "/archive/stanza1/archive.info.copy':\n"
INFO_COPY_EXT "':\n" " FileMissingError: unable to open missing file '" TEST_PATH_REPO "/archive/stanza1/archive.info' for read\n"
" FileMissingError: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "/stanza1/" " FileMissingError: unable to open missing file '" TEST_PATH_REPO "/archive/stanza1/archive.info.copy'"
INFO_ARCHIVE_FILE "' for read\n" " for read\n"
" FileMissingError: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "/stanza1/"
INFO_ARCHIVE_FILE INFO_COPY_EXT "' for read\n"
" HINT: archive.info cannot be opened but is required to push/get WAL segments.\n" " HINT: archive.info cannot be opened but is required to push/get WAL segments.\n"
" HINT: is archive_command configured correctly in postgresql.conf?\n" " HINT: is archive_command configured correctly in postgresql.conf?\n"
" HINT: has a stanza-create been performed?\n" " HINT: has a stanza-create been performed?\n"
@ -2248,13 +2246,12 @@ testRun(void)
"stanza: stanza1\n" "stanza: stanza1\n"
" status: mixed\n" " status: mixed\n"
" repo1: error (other)\n" " repo1: error (other)\n"
" [CryptoError] unable to load info file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/stanza1/" " [CryptoError] unable to load info file '" TEST_PATH_REPO "/backup/stanza1/backup.info' or '"
INFO_BACKUP_FILE "' or '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/stanza1/" INFO_BACKUP_FILE TEST_PATH_REPO "/backup/stanza1/backup.info.copy':\n"
INFO_COPY_EXT "':\n"
" CryptoError: cipher header invalid\n" " CryptoError: cipher header invalid\n"
" HINT: is or was the repo encrypted?\n" " HINT: is or was the repo encrypted?\n"
" FileMissingError: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/stanza1/" " FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/stanza1/backup.info.copy'"
INFO_BACKUP_FILE INFO_COPY_EXT "' for read\n" " for read\n"
" HINT: backup.info cannot be opened and is required to perform a backup.\n" " HINT: backup.info cannot be opened and is required to perform a backup.\n"
" HINT: has a stanza-create been performed?\n" " HINT: has a stanza-create been performed?\n"
" HINT: use option --stanza if encryption settings are different for the stanza than the global" " HINT: use option --stanza if encryption settings are different for the stanza than the global"
@ -2268,13 +2265,12 @@ testRun(void)
"stanza: stanza2\n" "stanza: stanza2\n"
" status: mixed\n" " status: mixed\n"
" repo1: error (other)\n" " repo1: error (other)\n"
" [CryptoError] unable to load info file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/stanza2/" " [CryptoError] unable to load info file '" TEST_PATH_REPO "/backup/stanza2/backup.info' or '"
INFO_BACKUP_FILE "' or '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/stanza2/" INFO_BACKUP_FILE TEST_PATH_REPO "/backup/stanza2/backup.info.copy':\n"
INFO_COPY_EXT "':\n"
" CryptoError: cipher header invalid\n" " CryptoError: cipher header invalid\n"
" HINT: is or was the repo encrypted?\n" " HINT: is or was the repo encrypted?\n"
" FileMissingError: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/stanza2/" " FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/stanza2/backup.info.copy'"
INFO_BACKUP_FILE INFO_COPY_EXT "' for read\n" " for read\n"
" HINT: backup.info cannot be opened and is required to perform a backup.\n" " HINT: backup.info cannot be opened and is required to perform a backup.\n"
" HINT: has a stanza-create been performed?\n" " HINT: has a stanza-create been performed?\n"
" HINT: use option --stanza if encryption settings are different for the stanza than the global" " HINT: use option --stanza if encryption settings are different for the stanza than the global"
@ -2285,13 +2281,12 @@ testRun(void)
"stanza: stanza3\n" "stanza: stanza3\n"
" status: mixed\n" " status: mixed\n"
" repo1: error (other)\n" " repo1: error (other)\n"
" [CryptoError] unable to load info file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/stanza3/" " [CryptoError] unable to load info file '" TEST_PATH_REPO "/backup/stanza3/backup.info' or '"
INFO_BACKUP_FILE "' or '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/stanza3/" INFO_BACKUP_FILE TEST_PATH_REPO "/backup/stanza3/backup.info.copy':\n"
INFO_COPY_EXT "':\n"
" CryptoError: cipher header invalid\n" " CryptoError: cipher header invalid\n"
" HINT: is or was the repo encrypted?\n" " HINT: is or was the repo encrypted?\n"
" FileMissingError: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/stanza3/" " FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/stanza3/backup.info.copy'"
INFO_BACKUP_FILE INFO_COPY_EXT "' for read\n" " for read\n"
" HINT: backup.info cannot be opened and is required to perform a backup.\n" " HINT: backup.info cannot be opened and is required to perform a backup.\n"
" HINT: has a stanza-create been performed?\n" " HINT: has a stanza-create been performed?\n"
" HINT: use option --stanza if encryption settings are different for the stanza than the global" " HINT: use option --stanza if encryption settings are different for the stanza than the global"
@ -2322,13 +2317,12 @@ testRun(void)
"stanza: stanza3\n" "stanza: stanza3\n"
" status: mixed\n" " status: mixed\n"
" repo1: error (other)\n" " repo1: error (other)\n"
" [CryptoError] unable to load info file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/stanza3/" " [CryptoError] unable to load info file '" TEST_PATH_REPO "/backup/stanza3/backup.info' or '"
INFO_BACKUP_FILE "' or '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/stanza3/" INFO_BACKUP_FILE TEST_PATH_REPO "/backup/stanza3/backup.info.copy':\n"
INFO_COPY_EXT "':\n"
" CryptoError: cipher header invalid\n" " CryptoError: cipher header invalid\n"
" HINT: is or was the repo encrypted?\n" " HINT: is or was the repo encrypted?\n"
" FileMissingError: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/stanza3/" " FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/stanza3/backup.info.copy'"
INFO_BACKUP_FILE INFO_COPY_EXT "' for read\n" " for read\n"
" HINT: backup.info cannot be opened and is required to perform a backup.\n" " HINT: backup.info cannot be opened and is required to perform a backup.\n"
" HINT: has a stanza-create been performed?\n" " HINT: has a stanza-create been performed?\n"
" HINT: use option --stanza if encryption settings are different for the stanza than the global" " HINT: use option --stanza if encryption settings are different for the stanza than the global"
@ -2353,8 +2347,8 @@ testRun(void)
"stanza: stanza1\n" "stanza: stanza1\n"
" status: mixed\n" " status: mixed\n"
" repo1: error (other)\n" " repo1: error (other)\n"
" [PathOpenError] unable to list file info for path '" TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE " [PathOpenError] unable to list file info for path '" TEST_PATH_REPO "/archive/stanza1/9.4-1': [13]"
"/stanza1/9.4-1': [13] Permission denied\n" " Permission denied\n"
" repo2: error (no valid backups)\n" " repo2: error (no valid backups)\n"
" cipher: mixed\n" " cipher: mixed\n"
" repo1: none\n" " repo1: none\n"

View File

@ -51,7 +51,7 @@ testRun(void)
// Create the stop file, test, then remove the stop file // Create the stop file, test, then remove the stop file
HRN_STORAGE_PUT_EMPTY(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza)))); HRN_STORAGE_PUT_EMPTY(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza))));
TEST_ERROR(cmdStanzaCreate(), StopError, "stop file exists for stanza " TEST_STANZA); TEST_ERROR(cmdStanzaCreate(), StopError, "stop file exists for stanza db");
HRN_STORAGE_REMOVE(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza)))); HRN_STORAGE_REMOVE(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza))));
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
@ -66,7 +66,7 @@ testRun(void)
hrnPgControlToBuffer((PgControl){.version = PG_VERSION_96, .systemId = 6569239123849665679})); hrnPgControlToBuffer((PgControl){.version = PG_VERSION_96, .systemId = 6569239123849665679}));
TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - one repo, no files exist"); TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - one repo, no files exist");
TEST_RESULT_LOG("P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'db' on repo1");
HRN_INFO_PUT( HRN_INFO_PUT(
storageHrn, "test.info", storageHrn, "test.info",
@ -126,11 +126,11 @@ testRun(void)
TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - files already exist on repo1 and both are valid"); TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - files already exist on repo1 and both are valid");
TEST_RESULT_LOG( TEST_RESULT_LOG(
"P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1\n" "P00 INFO: stanza-create for stanza 'db' on repo1\n"
"P00 INFO: stanza '" TEST_STANZA "' already exists on repo1 and is valid\n" "P00 INFO: stanza 'db' already exists on repo1 and is valid\n"
"P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo2\n" "P00 INFO: stanza-create for stanza 'db' on repo2\n"
"P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo3\n" "P00 INFO: stanza-create for stanza 'db' on repo3\n"
"P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo4"); "P00 INFO: stanza-create for stanza 'db' on repo4");
InfoArchive *infoArchive = NULL; InfoArchive *infoArchive = NULL;
TEST_ASSIGN( TEST_ASSIGN(
@ -189,10 +189,10 @@ testRun(void)
TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - success with missing files"); TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - success with missing files");
TEST_RESULT_LOG( TEST_RESULT_LOG(
"P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1\n" "P00 INFO: stanza-create for stanza 'db' on repo1\n"
"P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo2\n" "P00 INFO: stanza-create for stanza 'db' on repo2\n"
"P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo3\n" "P00 INFO: stanza-create for stanza 'db' on repo3\n"
"P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo4"); "P00 INFO: stanza-create for stanza 'db' on repo4");
TEST_RESULT_BOOL( TEST_RESULT_BOOL(
bufEq( bufEq(
@ -244,7 +244,7 @@ testRun(void)
TEST_ERROR( TEST_ERROR(
cmdStanzaDelete(), FileMissingError, cmdStanzaDelete(), FileMissingError,
"stop file does not exist for stanza '" TEST_STANZA "'\n" "stop file does not exist for stanza 'db'\n"
"HINT: has the pgbackrest stop command been run on this server for this stanza?"); "HINT: has the pgbackrest stop command been run on this server for this stanza?");
// Create the stop file // Create the stop file
@ -253,13 +253,13 @@ testRun(void)
TEST_STORAGE_LIST( TEST_STORAGE_LIST(
storageTest, "repo4", storageTest, "repo4",
"archive/\n" "archive/\n"
"archive/" TEST_STANZA "/\n" "archive/db/\n"
"archive/" TEST_STANZA "/archive.info\n" "archive/db/archive.info\n"
"archive/" TEST_STANZA "/archive.info.copy\n" "archive/db/archive.info.copy\n"
"backup/\n" "backup/\n"
"backup/" TEST_STANZA "/\n" "backup/db/\n"
"backup/" TEST_STANZA "/backup.info\n" "backup/db/backup.info\n"
"backup/" TEST_STANZA "/backup.info.copy\n", "backup/db/backup.info.copy\n",
.comment = "stanza exists in repo4"); .comment = "stanza exists in repo4");
TEST_RESULT_VOID(cmdStanzaDelete(), "stanza delete - repo4"); TEST_RESULT_VOID(cmdStanzaDelete(), "stanza delete - repo4");
@ -308,9 +308,9 @@ testRun(void)
"archive.info exists but backup.info is missing on repo2\n" "archive.info exists but backup.info is missing on repo2\n"
"HINT: this may be a symptom of repository corruption!"); "HINT: this may be a symptom of repository corruption!");
TEST_RESULT_LOG( TEST_RESULT_LOG(
"P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1\n" "P00 INFO: stanza-create for stanza 'db' on repo1\n"
"P00 INFO: stanza '" TEST_STANZA "' already exists on repo1 and is valid\n" "P00 INFO: stanza 'db' already exists on repo1 and is valid\n"
"P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo2"); "P00 INFO: stanza-create for stanza 'db' on repo2");
// Archive files removed - backup.info and backup.info.copy exist repo1 // Archive files removed - backup.info and backup.info.copy exist repo1
TEST_STORAGE_EXISTS( TEST_STORAGE_EXISTS(
@ -323,7 +323,7 @@ testRun(void)
cmdStanzaCreate(), FileMissingError, cmdStanzaCreate(), FileMissingError,
"backup.info exists but archive.info is missing on repo1\n" "backup.info exists but archive.info is missing on repo1\n"
"HINT: this may be a symptom of repository corruption!"); "HINT: this may be a symptom of repository corruption!");
TEST_RESULT_LOG("P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'db' on repo1");
// Delete the last repo so only 1 remains // Delete the last repo so only 1 remains
argListDelete = strLstDup(argListCmd); argListDelete = strLstDup(argListCmd);
@ -348,7 +348,7 @@ testRun(void)
cmdStanzaCreate(), FileMissingError, cmdStanzaCreate(), FileMissingError,
"backup.info exists but archive.info is missing on repo1\n" "backup.info exists but archive.info is missing on repo1\n"
"HINT: this may be a symptom of repository corruption!"); "HINT: this may be a symptom of repository corruption!");
TEST_RESULT_LOG("P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'db' on repo1");
// Archive files removed - backup.info.copy exists, backup.info moved to backup.info.copy // Archive files removed - backup.info.copy exists, backup.info moved to backup.info.copy
HRN_STORAGE_MOVE(storageRepoIdxWrite(0), INFO_BACKUP_PATH_FILE, INFO_BACKUP_PATH_FILE INFO_COPY_EXT); HRN_STORAGE_MOVE(storageRepoIdxWrite(0), INFO_BACKUP_PATH_FILE, INFO_BACKUP_PATH_FILE INFO_COPY_EXT);
@ -356,7 +356,7 @@ testRun(void)
cmdStanzaCreate(), FileMissingError, cmdStanzaCreate(), FileMissingError,
"backup.info exists but archive.info is missing on repo1\n" "backup.info exists but archive.info is missing on repo1\n"
"HINT: this may be a symptom of repository corruption!"); "HINT: this may be a symptom of repository corruption!");
TEST_RESULT_LOG("P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'db' on repo1");
// Backup files removed - archive.info file exists // Backup files removed - archive.info file exists
HRN_INFO_PUT( HRN_INFO_PUT(
@ -376,7 +376,7 @@ testRun(void)
cmdStanzaCreate(), FileMissingError, cmdStanzaCreate(), FileMissingError,
"archive.info exists but backup.info is missing on repo1\n" "archive.info exists but backup.info is missing on repo1\n"
"HINT: this may be a symptom of repository corruption!"); "HINT: this may be a symptom of repository corruption!");
TEST_RESULT_LOG("P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'db' on repo1");
// Backup files removed - archive.info.copy file exists (renamed from archive.info) // Backup files removed - archive.info.copy file exists (renamed from archive.info)
HRN_STORAGE_MOVE(storageRepoIdxWrite(0), INFO_ARCHIVE_PATH_FILE, INFO_ARCHIVE_PATH_FILE INFO_COPY_EXT); HRN_STORAGE_MOVE(storageRepoIdxWrite(0), INFO_ARCHIVE_PATH_FILE, INFO_ARCHIVE_PATH_FILE INFO_COPY_EXT);
@ -384,7 +384,7 @@ testRun(void)
cmdStanzaCreate(), FileMissingError, cmdStanzaCreate(), FileMissingError,
"archive.info exists but backup.info is missing on repo1\n" "archive.info exists but backup.info is missing on repo1\n"
"HINT: this may be a symptom of repository corruption!"); "HINT: this may be a symptom of repository corruption!");
TEST_RESULT_LOG("P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'db' on repo1");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("checkStanzaInfo() - already checked in checkTest so just a sanity check here"); TEST_TITLE("checkStanzaInfo() - already checked in checkTest so just a sanity check here");
@ -410,7 +410,7 @@ testRun(void)
"archive: id = 1, version = 9.6, system-id = 6569239123849665679\n" "archive: id = 1, version = 9.6, system-id = 6569239123849665679\n"
"backup : id = 2, version = 9.6, system-id = 6569239123849665679\n" "backup : id = 2, version = 9.6, system-id = 6569239123849665679\n"
"HINT: this may be a symptom of repository corruption!"); "HINT: this may be a symptom of repository corruption!");
TEST_RESULT_LOG("P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'db' on repo1");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("archive.info file and backup.info files that match but do not match the current database version"); TEST_TITLE("archive.info file and backup.info files that match but do not match the current database version");
@ -449,7 +449,7 @@ testRun(void)
"backup and archive info files exist but do not match the database\n" "backup and archive info files exist but do not match the database\n"
"HINT: is this the correct stanza?\n" "HINT: is this the correct stanza?\n"
"HINT: did an error occur during stanza-upgrade?"); "HINT: did an error occur during stanza-upgrade?");
TEST_RESULT_LOG("P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'db' on repo1");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("archive.info and backup.info files that match but do not match the current database system-id"); TEST_TITLE("archive.info and backup.info files that match but do not match the current database system-id");
@ -482,7 +482,7 @@ testRun(void)
"backup and archive info files exist but do not match the database\n" "backup and archive info files exist but do not match the database\n"
"HINT: is this the correct stanza?\n" "HINT: is this the correct stanza?\n"
"HINT: did an error occur during stanza-upgrade?"); "HINT: did an error occur during stanza-upgrade?");
TEST_RESULT_LOG("P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'db' on repo1");
// Remove the info files and add sub directory to backup // Remove the info files and add sub directory to backup
TEST_STORAGE_EXISTS(storageRepoIdxWrite(0), INFO_ARCHIVE_PATH_FILE, .remove = true); TEST_STORAGE_EXISTS(storageRepoIdxWrite(0), INFO_ARCHIVE_PATH_FILE, .remove = true);
@ -491,17 +491,17 @@ testRun(void)
storageRepoIdxWrite(0), STORAGE_REPO_BACKUP "/backup.history", .comment = "create directory in backup"); storageRepoIdxWrite(0), STORAGE_REPO_BACKUP "/backup.history", .comment = "create directory in backup");
TEST_ERROR(cmdStanzaCreate(), PathNotEmptyError, "backup directory not empty"); TEST_ERROR(cmdStanzaCreate(), PathNotEmptyError, "backup directory not empty");
TEST_RESULT_LOG("P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'db' on repo1");
// File in archive, directory in backup // File in archive, directory in backup
HRN_STORAGE_PUT_Z(storageRepoIdxWrite(0), STORAGE_REPO_ARCHIVE "/somefile", "some content"); HRN_STORAGE_PUT_Z(storageRepoIdxWrite(0), STORAGE_REPO_ARCHIVE "/somefile", "some content");
TEST_ERROR(cmdStanzaCreate(), PathNotEmptyError, "backup directory and/or archive directory not empty"); TEST_ERROR(cmdStanzaCreate(), PathNotEmptyError, "backup directory and/or archive directory not empty");
TEST_RESULT_LOG("P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'db' on repo1");
// File in archive, backup empty // File in archive, backup empty
HRN_STORAGE_PATH_REMOVE(storageRepoIdxWrite(0), STORAGE_REPO_BACKUP "/backup.history", .comment = "remove backup subdir"); HRN_STORAGE_PATH_REMOVE(storageRepoIdxWrite(0), STORAGE_REPO_BACKUP "/backup.history", .comment = "remove backup subdir");
TEST_ERROR(cmdStanzaCreate(), PathNotEmptyError, "archive directory not empty"); TEST_ERROR(cmdStanzaCreate(), PathNotEmptyError, "archive directory not empty");
TEST_RESULT_LOG("P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'db' on repo1");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("repeat last test using --force (deprecated)"); TEST_TITLE("repeat last test using --force (deprecated)");
@ -511,7 +511,7 @@ testRun(void)
TEST_ERROR(cmdStanzaCreate(), PathNotEmptyError, "archive directory not empty"); TEST_ERROR(cmdStanzaCreate(), PathNotEmptyError, "archive directory not empty");
TEST_RESULT_LOG( TEST_RESULT_LOG(
"P00 WARN: option --force is no longer supported\n" "P00 WARN: option --force is no longer supported\n"
"P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1"); "P00 INFO: stanza-create for stanza 'db' on repo1");
} }
// ***************************************************************************************************************************** // *****************************************************************************************************************************
@ -539,17 +539,17 @@ testRun(void)
}); });
TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - db online"); TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - db online");
TEST_RESULT_LOG("P00 INFO: stanza-create for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'db' on repo1");
TEST_STORAGE_LIST( TEST_STORAGE_LIST(
storageTest, TEST_PATH_REPO, storageTest, TEST_PATH_REPO,
"archive/\n" "archive/\n"
"archive/" TEST_STANZA "/\n" "archive/db/\n"
"archive/" TEST_STANZA "/archive.info\n" "archive/db/archive.info\n"
"archive/" TEST_STANZA "/archive.info.copy\n" "archive/db/archive.info.copy\n"
"backup/\n" "backup/\n"
"backup/" TEST_STANZA "/\n" "backup/db/\n"
"backup/" TEST_STANZA "/backup.info\n" "backup/db/backup.info\n"
"backup/" TEST_STANZA "/backup.info.copy\n", "backup/db/backup.info.copy\n",
.comment = "stanza created"); .comment = "stanza created");
HRN_CFG_LOAD(cfgCmdStanzaUpgrade, argList); HRN_CFG_LOAD(cfgCmdStanzaUpgrade, argList);
@ -561,8 +561,8 @@ testRun(void)
TEST_RESULT_VOID(cmdStanzaUpgrade(), "stanza upgrade - db online"); TEST_RESULT_VOID(cmdStanzaUpgrade(), "stanza upgrade - db online");
TEST_RESULT_LOG( TEST_RESULT_LOG(
"P00 INFO: stanza-upgrade for stanza '" TEST_STANZA "' on repo1\n" "P00 INFO: stanza-upgrade for stanza 'db' on repo1\n"
"P00 INFO: stanza '" TEST_STANZA "' on repo1 is already up to date"); "P00 INFO: stanza 'db' on repo1 is already up to date");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("pg_control and version mismatch"); TEST_TITLE("pg_control and version mismatch");
@ -580,8 +580,8 @@ testRun(void)
TEST_ERROR( TEST_ERROR(
pgValidate(), DbMismatchError, pgValidate(), DbMismatchError,
"version '" PG_VERSION_92_STR "' and path '" TEST_PATH_PG "' queried from cluster do not match version '" PG_VERSION_91_STR "' and " "version '" PG_VERSION_92_STR "' and path '" TEST_PATH_PG "' queried from cluster do not match version '"
"'" TEST_PATH_PG "' read from '" TEST_PATH_PG "/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL "'\n" PG_VERSION_91_STR "' and '" TEST_PATH_PG "' read from '" TEST_PATH_PG "/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL "'\n"
"HINT: the pg1-path and pg1-port settings likely reference different clusters."); "HINT: the pg1-path and pg1-port settings likely reference different clusters.");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
@ -659,7 +659,7 @@ testRun(void)
// Create the stop file, test and remove // Create the stop file, test and remove
HRN_STORAGE_PUT_EMPTY(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza)))); HRN_STORAGE_PUT_EMPTY(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza))));
TEST_ERROR(cmdStanzaUpgrade(), StopError, "stop file exists for stanza " TEST_STANZA); TEST_ERROR(cmdStanzaUpgrade(), StopError, "stop file exists for stanza db");
HRN_STORAGE_REMOVE(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza)))); HRN_STORAGE_REMOVE(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza))));
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
@ -702,7 +702,7 @@ testRun(void)
"archive: id = 2, version = 9.6, system-id = 6569239123849665679\n" "archive: id = 2, version = 9.6, system-id = 6569239123849665679\n"
"backup : id = 1, version = 9.6, system-id = 6569239123849665679\n" "backup : id = 1, version = 9.6, system-id = 6569239123849665679\n"
"HINT: this may be a symptom of repository corruption!"); "HINT: this may be a symptom of repository corruption!");
TEST_RESULT_LOG("P00 INFO: stanza-upgrade for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-upgrade for stanza 'db' on repo1");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("stanza-upgrade - info file mismatch: archive version"); TEST_TITLE("stanza-upgrade - info file mismatch: archive version");
@ -733,7 +733,7 @@ testRun(void)
"1={\"db-id\":6569239123849665679,\"db-version\":\"9.5\"}\n"); "1={\"db-id\":6569239123849665679,\"db-version\":\"9.5\"}\n");
TEST_RESULT_VOID(cmdStanzaUpgrade(), "stanza upgrade - archive.info file upgraded - version"); TEST_RESULT_VOID(cmdStanzaUpgrade(), "stanza upgrade - archive.info file upgraded - version");
TEST_RESULT_LOG("P00 INFO: stanza-upgrade for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-upgrade for stanza 'db' on repo1");
HRN_INFO_PUT( HRN_INFO_PUT(
storageHrn, "test.info", storageHrn, "test.info",
@ -830,7 +830,7 @@ testRun(void)
"1={\"db-id\":6569239123849665999,\"db-version\":\"9.6\"}\n"); "1={\"db-id\":6569239123849665999,\"db-version\":\"9.6\"}\n");
TEST_RESULT_VOID(cmdStanzaUpgrade(), "stanza upgrade - archive.info file upgraded - system-id"); TEST_RESULT_VOID(cmdStanzaUpgrade(), "stanza upgrade - archive.info file upgraded - system-id");
TEST_RESULT_LOG("P00 INFO: stanza-upgrade for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-upgrade for stanza 'db' on repo1");
HRN_INFO_PUT( HRN_INFO_PUT(
storageHrn, "test.info", storageHrn, "test.info",
@ -871,7 +871,7 @@ testRun(void)
"\"db-version\":\"9.6\"}\n"); "\"db-version\":\"9.6\"}\n");
TEST_RESULT_VOID(cmdStanzaUpgrade(), "stanza upgrade - backup.info file upgraded - system-id"); TEST_RESULT_VOID(cmdStanzaUpgrade(), "stanza upgrade - backup.info file upgraded - system-id");
TEST_RESULT_LOG("P00 INFO: stanza-upgrade for stanza '" TEST_STANZA "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-upgrade for stanza 'db' on repo1");
HRN_INFO_PUT( HRN_INFO_PUT(
storageHrn, "test.info", storageHrn, "test.info",
@ -918,7 +918,7 @@ testRun(void)
hrnPgControlToBuffer((PgControl){.version = PG_VERSION_96, .systemId = 6569239123849665679})); hrnPgControlToBuffer((PgControl){.version = PG_VERSION_96, .systemId = 6569239123849665679}));
TEST_RESULT_VOID(cmdStanzaCreate(), "create a stanza that will not be deleted"); TEST_RESULT_VOID(cmdStanzaCreate(), "create a stanza that will not be deleted");
TEST_RESULT_LOG("P00 INFO: stanza-create for stanza '" TEST_STANZA_OTHER "' on repo1"); TEST_RESULT_LOG("P00 INFO: stanza-create for stanza 'otherstanza' on repo1");
argList = strLstDup(argListCmd); argList = strLstDup(argListCmd);
hrnCfgArgRawZ(argList, cfgOptStanza, TEST_STANZA); hrnCfgArgRawZ(argList, cfgOptStanza, TEST_STANZA);
@ -939,10 +939,10 @@ testRun(void)
// Confirm stanza does not exist // Confirm stanza does not exist
TEST_STORAGE_LIST( TEST_STORAGE_LIST(
storageTest, "repo/archive", TEST_STANZA_OTHER "/\n", .noRecurse=true, storageTest, "repo/archive", "otherstanza/\n", .noRecurse=true,
.comment = "stanza '" TEST_STANZA "' archive does not exist"); .comment = "stanza '" TEST_STANZA "' archive does not exist");
TEST_STORAGE_LIST( TEST_STORAGE_LIST(
storageTest, "repo/backup", TEST_STANZA_OTHER "/\n", .noRecurse=true, storageTest, "repo/backup", "otherstanza/\n", .noRecurse=true,
.comment = "stanza '" TEST_STANZA "' backup does not exist"); .comment = "stanza '" TEST_STANZA "' backup does not exist");
// Create stanza archive only // Create stanza archive only
@ -951,13 +951,13 @@ testRun(void)
HRN_STORAGE_PUT_EMPTY(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza))), .comment = "create stop file"); HRN_STORAGE_PUT_EMPTY(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza))), .comment = "create stop file");
TEST_STORAGE_LIST( TEST_STORAGE_LIST(
storageTest, "repo/archive", storageTest, "repo/archive",
TEST_STANZA "/\n" "db/\n"
TEST_STANZA_OTHER "/\n", "otherstanza/\n",
.noRecurse = true, .comment = "stanza archive exists"); .noRecurse = true, .comment = "stanza archive exists");
TEST_RESULT_VOID(cmdStanzaDelete(), "stanza delete - archive only"); TEST_RESULT_VOID(cmdStanzaDelete(), "stanza delete - archive only");
TEST_STORAGE_LIST( TEST_STORAGE_LIST(
storageTest, "repo/archive", TEST_STANZA_OTHER "/\n", .noRecurse=true, .comment = "stanza '" TEST_STANZA "' deleted"); storageTest, "repo/archive", "otherstanza/\n", .noRecurse=true, .comment = "stanza '" TEST_STANZA "' deleted");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("stanza-delete - only backup exists"); TEST_TITLE("stanza-delete - only backup exists");
@ -969,13 +969,13 @@ testRun(void)
HRN_STORAGE_PUT_EMPTY(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza))), .comment = "create stop file"); HRN_STORAGE_PUT_EMPTY(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza))), .comment = "create stop file");
TEST_STORAGE_LIST( TEST_STORAGE_LIST(
storageTest, "repo/backup", storageTest, "repo/backup",
TEST_STANZA "/\n" "db/\n"
TEST_STANZA_OTHER "/\n", "otherstanza/\n",
.noRecurse = true, .comment = "stanza backup exists"); .noRecurse = true, .comment = "stanza backup exists");
TEST_RESULT_VOID(cmdStanzaDelete(), "stanza delete - backup only"); TEST_RESULT_VOID(cmdStanzaDelete(), "stanza delete - backup only");
TEST_STORAGE_LIST( TEST_STORAGE_LIST(
storageTest, "repo/backup", TEST_STANZA_OTHER "/\n", .noRecurse=true, .comment = "stanza '" TEST_STANZA "' deleted"); storageTest, "repo/backup", "otherstanza/\n", .noRecurse=true, .comment = "stanza '" TEST_STANZA "' deleted");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("stanza-delete - error on file that looks like backup directory"); TEST_TITLE("stanza-delete - error on file that looks like backup directory");
@ -986,8 +986,8 @@ testRun(void)
HRN_STORAGE_PUT_EMPTY(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza))), .comment = "create stop file"); HRN_STORAGE_PUT_EMPTY(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza))), .comment = "create stop file");
TEST_ERROR( TEST_ERROR(
cmdStanzaDelete(), FileRemoveError, cmdStanzaDelete(), FileRemoveError,
"unable to remove '" TEST_PATH_REPO "/backup/" TEST_STANZA "/20190708-154306F/backup.manifest': [20] Not a directory"); "unable to remove '" TEST_PATH_REPO "/backup/db/20190708-154306F/backup.manifest': [20] Not a directory");
HRN_STORAGE_REMOVE(storageTest, "repo/backup/" TEST_STANZA "/20190708-154306F", "cleanup - remove backup file"); HRN_STORAGE_REMOVE(storageTest, "repo/backup/db/20190708-154306F", "cleanup - remove backup file");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("manifestDelete()"); TEST_TITLE("manifestDelete()");
@ -1028,7 +1028,7 @@ testRun(void)
TEST_RESULT_VOID(cmdStanzaDelete(), "stanza delete - empty directories"); TEST_RESULT_VOID(cmdStanzaDelete(), "stanza delete - empty directories");
TEST_STORAGE_LIST( TEST_STORAGE_LIST(
storageTest, "repo/archive", TEST_STANZA_OTHER "/\n", .noRecurse=true, .comment = "stanza '" TEST_STANZA "' deleted"); storageTest, "repo/archive", "otherstanza/\n", .noRecurse=true, .comment = "stanza '" TEST_STANZA "' deleted");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("delete errors when pg appears to be running"); TEST_TITLE("delete errors when pg appears to be running");
@ -1040,8 +1040,7 @@ testRun(void)
TEST_ERROR( TEST_ERROR(
cmdStanzaDelete(), PgRunningError, PG_FILE_POSTMASTERPID " exists - looks like " PG_NAME " is running. " cmdStanzaDelete(), PgRunningError, PG_FILE_POSTMASTERPID " exists - looks like " PG_NAME " is running. "
"To delete stanza '" TEST_STANZA "' on repo1, shut down " PG_NAME " for stanza '" TEST_STANZA "To delete stanza 'db' on repo1, shut down " PG_NAME " for stanza 'db' and try again, or use --force.");
"' and try again, or use --force.");
// Specify repo option // Specify repo option
StringList *argListDel = strLstDup(argList); StringList *argListDel = strLstDup(argList);
@ -1053,8 +1052,7 @@ testRun(void)
TEST_ERROR( TEST_ERROR(
cmdStanzaDelete(), PgRunningError, PG_FILE_POSTMASTERPID " exists - looks like " PG_NAME " is running. " cmdStanzaDelete(), PgRunningError, PG_FILE_POSTMASTERPID " exists - looks like " PG_NAME " is running. "
"To delete stanza '" TEST_STANZA "' on repo2, shut down " PG_NAME " for stanza '" TEST_STANZA "To delete stanza 'db' on repo2, shut down " PG_NAME " for stanza 'db' and try again, or use --force.");
"' and try again, or use --force.");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("force delete when pg appears to be running, multi-repo"); TEST_TITLE("force delete when pg appears to be running, multi-repo");

View File

@ -254,9 +254,9 @@ testRun(void)
TEST_RESULT_PTR(manifest, NULL, "manifest not set - pg version mismatch"); TEST_RESULT_PTR(manifest, NULL, "manifest not set - pg version mismatch");
TEST_RESULT_UINT(backupResult.status, backupInvalid, "manifest unusable - backup invalid"); TEST_RESULT_UINT(backupResult.status, backupInvalid, "manifest unusable - backup invalid");
TEST_RESULT_LOG( TEST_RESULT_LOG(
"P00 WARN: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/db/" TEST_BACKUP_LABEL_FULL "/" "P00 WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/20181119-152138F/backup.manifest.copy'"
BACKUP_MANIFEST_FILE INFO_COPY_EXT "' for read\n" " for read\n"
"P00 ERROR: [028]: '" TEST_BACKUP_LABEL_FULL "' may not be recoverable - PG data (id 1, version 9.2, system-id " "P00 ERROR: [028]: '20181119-152138F' may not be recoverable - PG data (id 1, version 9.2, system-id "
"6625592122879095702) is not in the backup.info history, skipping"); "6625592122879095702) is not in the backup.info history, skipping");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
@ -289,10 +289,9 @@ testRun(void)
TEST_RESULT_PTR(manifest, NULL, "manifest not set - pg system-id mismatch"); TEST_RESULT_PTR(manifest, NULL, "manifest not set - pg system-id mismatch");
TEST_RESULT_UINT(backupResult.status, backupInvalid, "manifest unusable - backup invalid"); TEST_RESULT_UINT(backupResult.status, backupInvalid, "manifest unusable - backup invalid");
TEST_RESULT_LOG( TEST_RESULT_LOG(
"P00 WARN: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/db/" TEST_BACKUP_LABEL_FULL "/" "P00 WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/20181119-152138F/backup.manifest' for read\n"
BACKUP_MANIFEST_FILE "' for read\n" "P00 WARN: 20181119-152138F/backup.manifest is missing or unusable, using copy\n"
"P00 WARN: " TEST_BACKUP_LABEL_FULL "/backup.manifest is missing or unusable, using copy\n" "P00 ERROR: [028]: '20181119-152138F' may not be recoverable - PG data (id 1, version 9.4, system-id 0) is "
"P00 ERROR: [028]: '" TEST_BACKUP_LABEL_FULL "' may not be recoverable - PG data (id 1, version 9.4, system-id 0) is "
"not in the backup.info history, skipping"); "not in the backup.info history, skipping");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
@ -324,10 +323,9 @@ testRun(void)
TEST_RESULT_PTR(manifest, NULL, "manifest not set - pg db-id mismatch"); TEST_RESULT_PTR(manifest, NULL, "manifest not set - pg db-id mismatch");
TEST_RESULT_UINT(backupResult.status, backupInvalid, "manifest unusable - backup invalid"); TEST_RESULT_UINT(backupResult.status, backupInvalid, "manifest unusable - backup invalid");
TEST_RESULT_LOG( TEST_RESULT_LOG(
"P00 WARN: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/db/" TEST_BACKUP_LABEL_FULL "/" "P00 WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/20181119-152138F/backup.manifest' for read\n"
BACKUP_MANIFEST_FILE "' for read\n" "P00 WARN: 20181119-152138F/backup.manifest is missing or unusable, using copy\n"
"P00 WARN: " TEST_BACKUP_LABEL_FULL "/backup.manifest is missing or unusable, using copy\n" "P00 ERROR: [028]: '20181119-152138F' may not be recoverable - PG data (id 0, version 9.4, system-id "
"P00 ERROR: [028]: '" TEST_BACKUP_LABEL_FULL "' may not be recoverable - PG data (id 0, version 9.4, system-id "
"6625592122879095702) is not in the backup.info history, skipping"); "6625592122879095702) is not in the backup.info history, skipping");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
@ -342,10 +340,9 @@ testRun(void)
TEST_ASSIGN(manifest, verifyManifestFile(&backupResult, NULL, false, infoPg, &jobErrorTotal), "verify manifest"); TEST_ASSIGN(manifest, verifyManifestFile(&backupResult, NULL, false, infoPg, &jobErrorTotal), "verify manifest");
TEST_RESULT_UINT(backupResult.status, backupInvalid, "manifest unusable - backup invalid"); TEST_RESULT_UINT(backupResult.status, backupInvalid, "manifest unusable - backup invalid");
TEST_RESULT_LOG( TEST_RESULT_LOG(
"P00 WARN: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/db/" TEST_BACKUP_LABEL_FULL "/" "P00 WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/20181119-152138F/backup.manifest' for read\n"
BACKUP_MANIFEST_FILE "' for read\n"
"P00 WARN: invalid checksum, actual 'e056f784a995841fd4e2802b809299b8db6803a2' but expected 'BOGUS' " "P00 WARN: invalid checksum, actual 'e056f784a995841fd4e2802b809299b8db6803a2' but expected 'BOGUS' "
STORAGE_REPO_BACKUP "/" TEST_BACKUP_LABEL_FULL "/" BACKUP_MANIFEST_FILE INFO_COPY_EXT); "<REPO:BACKUP>/20181119-152138F/backup.manifest.copy");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
TEST_TITLE("current backup true"); TEST_TITLE("current backup true");
@ -359,9 +356,9 @@ testRun(void)
TEST_RESULT_UINT(backupResult.status, backupInvalid, "manifest unusable - backup invalid"); TEST_RESULT_UINT(backupResult.status, backupInvalid, "manifest unusable - backup invalid");
TEST_RESULT_LOG( TEST_RESULT_LOG(
"P00 WARN: invalid checksum, actual 'e056f784a995841fd4e2802b809299b8db6803a2' but expected 'BOGUS' " "P00 WARN: invalid checksum, actual 'e056f784a995841fd4e2802b809299b8db6803a2' but expected 'BOGUS' "
STORAGE_REPO_BACKUP "/" TEST_BACKUP_LABEL_FULL "/" BACKUP_MANIFEST_FILE "\n" "<REPO:BACKUP>/20181119-152138F/backup.manifest\n"
"P00 WARN: invalid checksum, actual 'e056f784a995841fd4e2802b809299b8db6803a2' but expected 'BOGUS' " "P00 WARN: invalid checksum, actual 'e056f784a995841fd4e2802b809299b8db6803a2' but expected 'BOGUS' "
STORAGE_REPO_BACKUP "/" TEST_BACKUP_LABEL_FULL "/" BACKUP_MANIFEST_FILE INFO_COPY_EXT); "<REPO:BACKUP>/20181119-152138F/backup.manifest.copy");
// Write a valid manifest with a manifest copy that is invalid // Write a valid manifest with a manifest copy that is invalid
HRN_INFO_PUT( HRN_INFO_PUT(
@ -383,7 +380,7 @@ testRun(void)
TEST_ASSIGN(manifest, verifyManifestFile(&backupResult, NULL, true, infoPg, &jobErrorTotal), "verify manifest"); TEST_ASSIGN(manifest, verifyManifestFile(&backupResult, NULL, true, infoPg, &jobErrorTotal), "verify manifest");
TEST_RESULT_PTR_NE(manifest, NULL, "manifest set"); TEST_RESULT_PTR_NE(manifest, NULL, "manifest set");
TEST_RESULT_UINT(backupResult.status, backupValid, "manifest usable"); TEST_RESULT_UINT(backupResult.status, backupValid, "manifest usable");
TEST_RESULT_LOG("P00 WARN: backup '" TEST_BACKUP_LABEL_FULL "' manifest.copy does not match manifest"); TEST_RESULT_LOG("P00 WARN: backup '20181119-152138F' manifest.copy does not match manifest");
} }
// ***************************************************************************************************************************** // *****************************************************************************************************************************
@ -760,13 +757,10 @@ testRun(void)
TEST_RESULT_LOG( TEST_RESULT_LOG(
"P00 WARN: invalid checksum, actual 'e056f784a995841fd4e2802b809299b8db6803a2' but expected 'BOGUS' " "P00 WARN: invalid checksum, actual 'e056f784a995841fd4e2802b809299b8db6803a2' but expected 'BOGUS' "
"<REPO:BACKUP>/backup.info\n" "<REPO:BACKUP>/backup.info\n"
"P00 WARN: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/db/" INFO_BACKUP_FILE INFO_COPY_EXT "P00 WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/backup.info.copy' for read\n"
"' for read\n"
"P00 ERROR: [029]: No usable backup.info file\n" "P00 ERROR: [029]: No usable backup.info file\n"
"P00 WARN: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "/db/" INFO_ARCHIVE_FILE "P00 WARN: unable to open missing file '" TEST_PATH_REPO "/archive/db/archive.info' for read\n"
"' for read\n" "P00 WARN: unable to open missing file '" TEST_PATH_REPO "/archive/db/archive.info.copy' for read\n"
"P00 WARN: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "/db/" INFO_ARCHIVE_FILE
INFO_COPY_EXT "' for read\n"
"P00 ERROR: [029]: No usable archive.info file"); "P00 ERROR: [029]: No usable archive.info file");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
@ -790,8 +784,7 @@ testRun(void)
TEST_RESULT_LOG( TEST_RESULT_LOG(
"P00 WARN: invalid checksum, actual 'e056f784a995841fd4e2802b809299b8db6803a2' but expected 'BOGUS'" "P00 WARN: invalid checksum, actual 'e056f784a995841fd4e2802b809299b8db6803a2' but expected 'BOGUS'"
" <REPO:BACKUP>/backup.info\n" " <REPO:BACKUP>/backup.info\n"
"P00 WARN: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "/db/" INFO_ARCHIVE_FILE "P00 WARN: unable to open missing file '" TEST_PATH_REPO "/archive/db/archive.info' for read\n"
"' for read\n"
"P00 WARN: invalid checksum, actual 'e056f784a995841fd4e2802b809299b8db6803a2' but expected 'BOGUS'" "P00 WARN: invalid checksum, actual 'e056f784a995841fd4e2802b809299b8db6803a2' but expected 'BOGUS'"
" <REPO:ARCHIVE>/archive.info.copy\n" " <REPO:ARCHIVE>/archive.info.copy\n"
"P00 ERROR: [029]: No usable archive.info file"); "P00 ERROR: [029]: No usable archive.info file");
@ -835,10 +828,8 @@ testRun(void)
HRN_STORAGE_REMOVE(storageRepoWrite(), INFO_ARCHIVE_PATH_FILE INFO_COPY_EXT, .comment = "remove archive.info.copy"); HRN_STORAGE_REMOVE(storageRepoWrite(), INFO_ARCHIVE_PATH_FILE INFO_COPY_EXT, .comment = "remove archive.info.copy");
TEST_RESULT_VOID(cmdVerify(), "usable backup and archive info files"); TEST_RESULT_VOID(cmdVerify(), "usable backup and archive info files");
TEST_RESULT_LOG( TEST_RESULT_LOG(
"P00 WARN: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/db/" INFO_BACKUP_FILE "P00 WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/backup.info.copy' for read\n"
INFO_COPY_EXT "' for read\n" "P00 WARN: unable to open missing file '" TEST_PATH_REPO "/archive/db/archive.info.copy' for read\n"
"P00 WARN: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "/db/" INFO_ARCHIVE_FILE
INFO_COPY_EXT "' for read\n"
"P00 WARN: no archives or backups exist in the repo"); "P00 WARN: no archives or backups exist in the repo");
//-------------------------------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------------------------------
@ -850,10 +841,8 @@ testRun(void)
.comment = "valid and matching archive.info.copy"); .comment = "valid and matching archive.info.copy");
TEST_ERROR(cmdVerify(), RuntimeError, "1 fatal errors encountered, see log for details"); TEST_ERROR(cmdVerify(), RuntimeError, "1 fatal errors encountered, see log for details");
TEST_RESULT_LOG( TEST_RESULT_LOG(
"P00 WARN: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/db/" INFO_BACKUP_FILE "P00 WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/backup.info' for read\n"
"' for read\n" "P00 WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/backup.info.copy' for read\n"
"P00 WARN: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/db/" INFO_BACKUP_FILE
INFO_COPY_EXT "' for read\n"
"P00 ERROR: [029]: No usable backup.info file"); "P00 ERROR: [029]: No usable backup.info file");
} }
@ -1182,25 +1171,23 @@ testRun(void)
"'11-2/0000000200000007/000000020000000700000FFF-ee161f898c9012dd0c28b3fd1e7140b9cf411306'\n" "'11-2/0000000200000007/000000020000000700000FFF-ee161f898c9012dd0c28b3fd1e7140b9cf411306'\n"
"P01 ERROR: [039]: invalid result " "P01 ERROR: [039]: invalid result "
"11-2/0000000200000008/000000020000000800000003-656817043007aa2100c44c712bcb456db705dab9: [41] raised from " "11-2/0000000200000008/000000020000000800000003-656817043007aa2100c44c712bcb456db705dab9: [41] raised from "
"local-1 shim protocol: unable to open file '" TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "/db/" "local-1 shim protocol: unable to open file '" TEST_PATH_REPO "/archive/db/"
"11-2/0000000200000008/000000020000000800000003-656817043007aa2100c44c712bcb456db705dab9' for read:" "11-2/0000000200000008/000000020000000800000003-656817043007aa2100c44c712bcb456db705dab9' for read:"
" [13] Permission denied\n" " [13] Permission denied\n"
"P00 WARN: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/db/20181119-152800F/" "P00 WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/20181119-152800F/backup.manifest' for read\n"
BACKUP_MANIFEST_FILE "' for read\n" "P00 WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/20181119-152800F/backup.manifest.copy'"
"P00 WARN: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/db/20181119-152800F/" " for read\n"
BACKUP_MANIFEST_FILE INFO_COPY_EXT "' for read\n"
"P00 WARN: manifest missing for '20181119-152800F' - backup may have expired\n" "P00 WARN: manifest missing for '20181119-152800F' - backup may have expired\n"
"P00 WARN: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/db/20181119-152810F/" "P00 WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/20181119-152810F/backup.manifest.copy'"
BACKUP_MANIFEST_FILE INFO_COPY_EXT "' for read\n" " for read\n"
"P00 ERROR: [028]: backup '20181119-152810F' manifest does not contain any target files to verify\n" "P00 ERROR: [028]: backup '20181119-152810F' manifest does not contain any target files to verify\n"
"P01 ERROR: [028]: invalid checksum '20181119-152900F/pg_data/PG_VERSION'\n" "P01 ERROR: [028]: invalid checksum '20181119-152900F/pg_data/PG_VERSION'\n"
"P01 ERROR: [028]: file missing '20181119-152900F_20181119-152909D/pg_data/testmissing'\n" "P01 ERROR: [028]: file missing '20181119-152900F_20181119-152909D/pg_data/testmissing'\n"
"P00 WARN: unable to open missing file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/db/20181119-153000F/" "P00 WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/20181119-153000F/backup.manifest' for read\n"
BACKUP_MANIFEST_FILE "' for read\n"
"P00 INFO: backup '20181119-153000F' appears to be in progress, skipping\n" "P00 INFO: backup '20181119-153000F' appears to be in progress, skipping\n"
"P01 ERROR: [039]: invalid result UNPROCESSEDBACKUP/pg_data/testother: [41] raised from local-1 shim protocol:" "P01 ERROR: [039]: invalid result UNPROCESSEDBACKUP/pg_data/testother: [41] raised from local-1 shim protocol:"
" unable to open file '" TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/db/UNPROCESSEDBACKUP/pg_data/testother'" " unable to open file '" TEST_PATH_REPO "/backup/db/UNPROCESSEDBACKUP/pg_data/testother' for read: [13]"
" for read: [13] Permission denied\n" " Permission denied\n"
"P00 DETAIL: archiveId: 11-2, wal start: 000000020000000700000FFD, wal stop: 000000020000000800000000\n" "P00 DETAIL: archiveId: 11-2, wal start: 000000020000000700000FFD, wal stop: 000000020000000800000000\n"
"P00 DETAIL: archiveId: 11-2, wal start: 000000020000000800000002, wal stop: 000000020000000800000003\n" "P00 DETAIL: archiveId: 11-2, wal start: 000000020000000800000002, wal stop: 000000020000000800000003\n"
"P00 DETAIL: archiveId: 11-2, wal start: 000000030000000000000000, wal stop: 000000030000000000000001\n" "P00 DETAIL: archiveId: 11-2, wal start: 000000030000000000000000, wal stop: 000000030000000000000001\n"