You've already forked pgbackrest
							
							
				mirror of
				https://github.com/pgbackrest/pgbackrest.git
				synced 2025-10-30 23:37:45 +02:00 
			
		
		
		
	Remove TEST_PATH_REPO, TEST_PATH_PG, and TEST_PATH_SPOOL constants.
It seems better to use TEST_PATH in combination with a constant string rather than have a number of different path constants. This improves readability and reduces confusion about which constant should be used.
This commit is contained in:
		| @@ -395,7 +395,7 @@ if (testBegin("expireBackup()")) | ||||
| The [harnessConfig.h](https://github.com/pgbackrest/pgbackrest/blob/master/test/src/common/harnessConfig.h) describes a list of functions that should be used when configuration options are required for a command being tested. Options are set in a `StringList` which must be defined and passed to the `HRN_CFG_LOAD()` macro with the command. For example, the following will set up a test to run `pgbackrest --repo-path=test/test-0/repo info` command on multiple repositories, one of which is encrypted: | ||||
| ``` | ||||
| StringList *argList = strLstNew();                                  // Create an empty string list | ||||
| hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO);             // Add the --repo-path option | ||||
| hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo");          // Add the --repo-path option | ||||
| hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 2, TEST_PATH "/repo2");   // Add the --repo2-path option | ||||
| hrnCfgArgKeyRawStrId(argList, cfgOptRepoCipherType, 2, cipherTypeAes256Cbc);  // Add the --repo2-cipher-type option | ||||
| hrnCfgEnvKeyRawZ(cfgOptRepoCipherPass, 2, TEST_CIPHER_PASS);        // Set environment variable for the --repo2-cipher-pass option | ||||
|   | ||||
| @@ -446,7 +446,7 @@ if (testBegin("expireBackup()")) | ||||
|  | ||||
|                 <code-block> | ||||
| StringList *argList = strLstNew();                                  // Create an empty string list | ||||
| hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO);             // Add the --repo-path option | ||||
| hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo");          // Add the --repo-path option | ||||
| hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 2, TEST_PATH "/repo2");   // Add the --repo2-path option | ||||
| hrnCfgArgKeyRawStrId(argList, cfgOptRepoCipherType, 2, cipherTypeAes256Cbc);  // Add the --repo2-cipher-type option | ||||
| hrnCfgEnvKeyRawZ(cfgOptRepoCipherPass, 2, TEST_CIPHER_PASS);        // Set environment variable for the --repo2-cipher-pass option | ||||
|   | ||||
| @@ -14,10 +14,6 @@ Prefix for environment variables | ||||
| /*********************************************************************************************************************************** | ||||
| Config option constants | ||||
| ***********************************************************************************************************************************/ | ||||
| #define TEST_PATH_REPO                                              TEST_PATH "/repo" | ||||
| #define TEST_PATH_PG                                                TEST_PATH "/pg" | ||||
| #define TEST_PATH_SPOOL                                             TEST_PATH "/spool" | ||||
|  | ||||
| #define TEST_CIPHER_PASS                                            "xmainx" | ||||
| #define TEST_CIPHER_PASS_ARCHIVE                                    "xarchivex" | ||||
|  | ||||
|   | ||||
| @@ -106,9 +106,9 @@ testRun(void) | ||||
|  | ||||
|         // Arguments that must be included | ||||
|         StringList *argBaseList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptSpoolPath, TEST_PATH_SPOOL); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptSpoolPath, TEST_PATH "/spool"); | ||||
|         hrnCfgArgRawBool(argBaseList, cfgOptArchiveAsync, true); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptStanza, "test2"); | ||||
|  | ||||
| @@ -175,7 +175,7 @@ testRun(void) | ||||
|  | ||||
|         TEST_RESULT_LOG( | ||||
|             "P00   INFO: get 1 WAL file(s) from archive: 000000010000000100000001\n" | ||||
|             "P00   WARN: repo1: [PathOpenError] unable to list file info for path '" TEST_PATH_REPO "/archive/test2/10-1" | ||||
|             "P00   WARN: repo1: [PathOpenError] unable to list file info for path '" TEST_PATH "/repo/archive/test2/10-1" | ||||
|                 "/0000000100000001': [13] Permission denied\n" | ||||
|             "P00   WARN: [RepoInvalidError] unable to find a valid repository"); | ||||
|  | ||||
| @@ -183,7 +183,7 @@ testRun(void) | ||||
|             storageSpoolWrite(), STORAGE_SPOOL_ARCHIVE_IN "/000000010000000100000001.error", | ||||
|             "103\n" | ||||
|             "unable to find a valid repository\n" | ||||
|             "repo1: [PathOpenError] unable to list file info for path '" TEST_PATH_REPO "/archive/test2/10-1/0000000100000001':" | ||||
|             "repo1: [PathOpenError] unable to list file info for path '" TEST_PATH "/repo/archive/test2/10-1/0000000100000001':" | ||||
|                 " [13] Permission denied", | ||||
|             .remove = true); | ||||
|         TEST_STORAGE_LIST_EMPTY(storageSpool(), STORAGE_SPOOL_ARCHIVE_IN); | ||||
| @@ -314,7 +314,7 @@ testRun(void) | ||||
|         // ------------------------------------------------------------------------------------------------------------------------- | ||||
|         TEST_TITLE("multiple segments where some are missing or errored and mismatched repo"); | ||||
|  | ||||
|         hrnCfgArgKeyRawZ(argBaseList, cfgOptRepoPath, 2, TEST_PATH_REPO "2"); | ||||
|         hrnCfgArgKeyRawZ(argBaseList, cfgOptRepoPath, 2, TEST_PATH "/repo2"); | ||||
|  | ||||
|         argList = strLstDup(argBaseList); | ||||
|         strLstAddZ(argList, "0000000100000001000000FE"); | ||||
| @@ -380,10 +380,10 @@ testRun(void) | ||||
|         TEST_RESULT_VOID(cmdArchiveGetAsync(), "archive async"); | ||||
|  | ||||
|         #define TEST_WARN1                                                                                                         \ | ||||
|             "repo2: [PathOpenError] unable to list file info for path '" TEST_PATH_REPO "2/archive/test2/10-1"                     \ | ||||
|             "repo2: [PathOpenError] unable to list file info for path '" TEST_PATH "/repo2/archive/test2/10-1"                     \ | ||||
|                 "/0000000100000001': [13] Permission denied" | ||||
|         #define TEST_WARN2                                                                                                         \ | ||||
|             "repo2: [PathOpenError] unable to list file info for path '" TEST_PATH_REPO "2/archive/test2/10-1"                     \ | ||||
|             "repo2: [PathOpenError] unable to list file info for path '" TEST_PATH "/repo2/archive/test2/10-1"                     \ | ||||
|                 "/0000000100000002': [13] Permission denied" | ||||
|  | ||||
|         TEST_RESULT_LOG( | ||||
| @@ -455,7 +455,7 @@ testRun(void) | ||||
|         // ------------------------------------------------------------------------------------------------------------------------- | ||||
|         TEST_TITLE("warn on invalid file"); | ||||
|  | ||||
|         hrnCfgArgKeyRawZ(argBaseList, cfgOptRepoPath, 3, TEST_PATH_REPO "3"); | ||||
|         hrnCfgArgKeyRawZ(argBaseList, cfgOptRepoPath, 3, TEST_PATH "/repo3"); | ||||
|  | ||||
|         argList = strLstDup(argBaseList); | ||||
|         strLstAddZ(argList, "000000010000000200000000"); | ||||
| @@ -540,9 +540,9 @@ testRun(void) | ||||
|         hrnProtocolLocalShimUninstall(); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptSpoolPath, TEST_PATH_SPOOL); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptSpoolPath, TEST_PATH "/spool"); | ||||
|         hrnCfgArgRawBool(argList, cfgOptArchiveAsync, true); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, "test2"); | ||||
|         strLstAddZ(argList, "0000000100000001000000FE"); | ||||
| @@ -573,8 +573,8 @@ testRun(void) | ||||
|  | ||||
|         // Arguments that must be included. Use raw config here because we need to keep the | ||||
|         StringList *argBaseList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptStanza, "test1"); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptArchiveTimeout, "1"); | ||||
|  | ||||
| @@ -605,16 +605,16 @@ testRun(void) | ||||
|             storagePgWrite(), PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL, | ||||
|             hrnPgControlToBuffer((PgControl){.version = PG_VERSION_10, .systemId = 0xFACEFACEFACEFACE})); | ||||
|  | ||||
|         strLstAddZ(argList, TEST_PATH_PG "/pg_wal/RECOVERYXLOG"); | ||||
|         strLstAddZ(argList, TEST_PATH "/pg/pg_wal/RECOVERYXLOG"); | ||||
|         HRN_CFG_LOAD(cfgCmdArchiveGet, argList, .exeBogus = true); | ||||
|  | ||||
|         TEST_ERROR(cmdArchiveGet(), RepoInvalidError, "unable to find a valid repository"); | ||||
|  | ||||
|         TEST_RESULT_LOG( | ||||
|             "P00   WARN: repo1: [FileMissingError] unable to load info file '" TEST_PATH_REPO "/archive/test1/archive.info' or '" | ||||
|                 TEST_PATH_REPO "/archive/test1/archive.info.copy':\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH_REPO "/archive/test1/archive.info' for read\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH_REPO "/archive/test1/archive.info.copy' for" | ||||
|             "P00   WARN: repo1: [FileMissingError] unable to load info file '" TEST_PATH "/repo/archive/test1/archive.info' or '" | ||||
|                 TEST_PATH "/repo/archive/test1/archive.info.copy':\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH "/repo/archive/test1/archive.info' for read\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH "/repo/archive/test1/archive.info.copy' for" | ||||
|                 " read\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" | ||||
| @@ -625,17 +625,17 @@ testRun(void) | ||||
|         // ------------------------------------------------------------------------------------------------------------------------- | ||||
|         argList = strLstDup(argBaseList); | ||||
|         strLstAddZ(argList, "00000001.history"); | ||||
|         strLstAddZ(argList, TEST_PATH_PG "/pg_wal/RECOVERYHISTORY"); | ||||
|         strLstAddZ(argList, TEST_PATH "/pg/pg_wal/RECOVERYHISTORY"); | ||||
|         strLstAddZ(argList, "--archive-async"); | ||||
|         HRN_CFG_LOAD(cfgCmdArchiveGet, argList, .exeBogus = true); | ||||
|  | ||||
|         TEST_ERROR(cmdArchiveGet(), RepoInvalidError, "unable to find a valid repository"); | ||||
|  | ||||
|         TEST_RESULT_LOG( | ||||
|             "P00   WARN: repo1: [FileMissingError] unable to load info file '" TEST_PATH_REPO "/archive/test1/archive.info' or '" | ||||
|                 TEST_PATH_REPO "/archive/test1/archive.info.copy':\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH_REPO "/archive/test1/archive.info' for read\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH_REPO "/archive/test1/archive.info.copy' for" | ||||
|             "P00   WARN: repo1: [FileMissingError] unable to load info file '" TEST_PATH "/repo/archive/test1/archive.info' or '" | ||||
|                 TEST_PATH "/repo/archive/test1/archive.info.copy':\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH "/repo/archive/test1/archive.info' for read\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH "/repo/archive/test1/archive.info.copy' for" | ||||
|                 " read\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" | ||||
| @@ -646,7 +646,7 @@ testRun(void) | ||||
|         // Make sure the process times out when there is nothing to get | ||||
|         // ------------------------------------------------------------------------------------------------------------------------- | ||||
|         argList = strLstDup(argBaseList); | ||||
|         hrnCfgArgRawZ(argList, cfgOptSpoolPath, TEST_PATH_SPOOL); | ||||
|         hrnCfgArgRawZ(argList, cfgOptSpoolPath, TEST_PATH "/spool"); | ||||
|         hrnCfgArgRawBool(argList, cfgOptArchiveAsync, true); | ||||
|         strLstAddZ(argList, "000000010000000100000001"); | ||||
|         strLstAddZ(argList, "pg_wal/RECOVERYXLOG"); | ||||
| @@ -770,13 +770,13 @@ testRun(void) | ||||
|             "1={\"db-id\":18072658121562454734,\"db-version\":\"10\"}"); | ||||
|  | ||||
|         argBaseList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawZ(argBaseList, cfgOptStanza, "test1"); | ||||
|  | ||||
|         argList = strLstDup(argBaseList); | ||||
|         strLstAddZ(argList, "01ABCDEF01ABCDEF01ABCDEF"); | ||||
|         strLstAddZ(argList, TEST_PATH_PG "/pg_wal/RECOVERYXLOG"); | ||||
|         strLstAddZ(argList, TEST_PATH "/pg/pg_wal/RECOVERYXLOG"); | ||||
|         HRN_CFG_LOAD(cfgCmdArchiveGet, argList); | ||||
|  | ||||
|         TEST_ERROR(cmdArchiveGet(), RepoInvalidError, "unable to find a valid repository"); | ||||
| @@ -899,7 +899,7 @@ testRun(void) | ||||
|  | ||||
|         argList = strLstDup(argBaseList); | ||||
|         strLstAddZ(argList, "000000010000000100000001.partial"); | ||||
|         strLstAddZ(argList, TEST_PATH_PG "/pg_wal/RECOVERYXLOG"); | ||||
|         strLstAddZ(argList, TEST_PATH "/pg/pg_wal/RECOVERYXLOG"); | ||||
|         HRN_CFG_LOAD(cfgCmdArchiveGet, argList); | ||||
|  | ||||
|         TEST_RESULT_INT(cmdArchiveGet(), 0, "get"); | ||||
| @@ -916,7 +916,7 @@ testRun(void) | ||||
|  | ||||
|         argList = strLstDup(argBaseList); | ||||
|         strLstAddZ(argList, "00000001.history"); | ||||
|         strLstAddZ(argList, TEST_PATH_PG "/pg_wal/RECOVERYHISTORY"); | ||||
|         strLstAddZ(argList, TEST_PATH "/pg/pg_wal/RECOVERYHISTORY"); | ||||
|         HRN_CFG_LOAD(cfgCmdArchiveGet, argList); | ||||
|  | ||||
|         TEST_RESULT_INT(cmdArchiveGet(), 1, "get"); | ||||
| @@ -958,25 +958,25 @@ testRun(void) | ||||
|  | ||||
|         // Add encryption options | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 1, TEST_PATH_REPO "-bogus"); | ||||
|         hrnCfgArgKeyRawFmt(argList, cfgOptRepoPath, 2, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 1, TEST_PATH "/repo-bogus"); | ||||
|         hrnCfgArgKeyRawFmt(argList, cfgOptRepoPath, 2, TEST_PATH "/repo"); | ||||
|         hrnCfgArgKeyRawStrId(argList, cfgOptRepoCipherType, 2, cipherTypeAes256Cbc); | ||||
|         hrnCfgEnvKeyRawZ(cfgOptRepoCipherPass, 2, TEST_CIPHER_PASS); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); | ||||
|         strLstAddZ(argList, "01ABCDEF01ABCDEF01ABCDEF"); | ||||
|         strLstAddZ(argList, TEST_PATH_PG "/pg_wal/RECOVERYXLOG"); | ||||
|         strLstAddZ(argList, TEST_PATH "/pg/pg_wal/RECOVERYXLOG"); | ||||
|         HRN_CFG_LOAD(cfgCmdArchiveGet, argList); | ||||
|         hrnCfgEnvKeyRemoveRaw(cfgOptRepoCipherPass, 2); | ||||
|  | ||||
|         TEST_RESULT_INT(cmdArchiveGet(), 0, "get"); | ||||
|  | ||||
|         TEST_RESULT_LOG( | ||||
|             "P00   WARN: repo1: [FileMissingError] unable to load info file '" TEST_PATH_REPO "-bogus/archive/test1/archive.info'" | ||||
|                 " or '" TEST_PATH_REPO "-bogus/archive/test1/archive.info.copy':\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH_REPO "-bogus/archive/test1/archive.info'" | ||||
|             "P00   WARN: repo1: [FileMissingError] unable to load info file '" TEST_PATH "/repo-bogus/archive/test1/archive.info'" | ||||
|                 " or '" TEST_PATH "/repo-bogus/archive/test1/archive.info.copy':\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH "/repo-bogus/archive/test1/archive.info'" | ||||
|                 " for read\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH_REPO "-bogus/archive/test1/archive.info.copy'" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH "/repo-bogus/archive/test1/archive.info.copy'" | ||||
|                 " for read\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" | ||||
| @@ -1004,7 +1004,7 @@ testRun(void) | ||||
|         TEST_RESULT_INT(cmdArchiveGet(), 0, "get"); | ||||
|  | ||||
|         TEST_RESULT_LOG( | ||||
|             "P00   WARN: repo1: [PathOpenError] unable to list file info for path '" TEST_PATH_REPO "-bogus/archive/test1/10-2" | ||||
|             "P00   WARN: repo1: [PathOpenError] unable to list file info for path '" TEST_PATH "/repo-bogus/archive/test1/10-2" | ||||
|                 "/01ABCDEF01ABCDEF': [13] Permission denied\n" | ||||
|             "P00   INFO: found 01ABCDEF01ABCDEF01ABCDEF in the repo2: 10-1 archive"); | ||||
|  | ||||
| @@ -1018,9 +1018,9 @@ testRun(void) | ||||
|         TEST_ERROR(cmdArchiveGet(), RepoInvalidError, "unable to find a valid repository"); | ||||
|  | ||||
|         TEST_RESULT_LOG( | ||||
|             "P00   WARN: repo1: [PathOpenError] unable to list file info for path '" TEST_PATH_REPO "-bogus/archive/test1/10-2" | ||||
|             "P00   WARN: repo1: [PathOpenError] unable to list file info for path '" TEST_PATH "/repo-bogus/archive/test1/10-2" | ||||
|                 "/01ABCDEF01ABCDEF': [13] Permission denied\n" | ||||
|             "P00   WARN: repo2: [PathOpenError] unable to list file info for path '" TEST_PATH_REPO "/archive/test1/10-1" | ||||
|             "P00   WARN: repo2: [PathOpenError] unable to list file info for path '" TEST_PATH "/repo/archive/test1/10-1" | ||||
|                 "/01ABCDEF01ABCDEF': [13] Permission denied"); | ||||
|  | ||||
|         HRN_STORAGE_MODE(storageRepoIdxWrite(0), STORAGE_REPO_ARCHIVE "/10-2"); | ||||
| @@ -1053,7 +1053,7 @@ testRun(void) | ||||
|             "repo1: 10-2/01ABCDEF01ABCDEF/01ABCDEF01ABCDEF01ABCDEF-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.gz [FormatError]" | ||||
|                 " unexpected eof in compressed data\n" | ||||
|             "repo2: 10-1/01ABCDEF01ABCDEF/01ABCDEF01ABCDEF01ABCDEF-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.gz [FileOpenError]" | ||||
|                 " unable to open file '" TEST_PATH_REPO "/archive/test1/10-1/01ABCDEF01ABCDEF/01ABCDEF01ABCDEF01ABCDEF" | ||||
|                 " unable to open file '" TEST_PATH "/repo/archive/test1/10-1/01ABCDEF01ABCDEF/01ABCDEF01ABCDEF01ABCDEF" | ||||
|                     "-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.gz' for read: [13] Permission denied"); | ||||
|  | ||||
|         HRN_STORAGE_MODE( | ||||
| @@ -1077,11 +1077,11 @@ testRun(void) | ||||
|         TEST_TITLE("no segments to find with existing ok file"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptArchiveTimeout, "10"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptSpoolPath, TEST_PATH_SPOOL); | ||||
|         hrnCfgArgRawZ(argList, cfgOptSpoolPath, TEST_PATH "/spool"); | ||||
|         hrnCfgArgRawBool(argList, cfgOptArchiveAsync, true); | ||||
|         strLstAddZ(argList, "000000010000000100000001"); | ||||
|         strLstAddZ(argList, "pg_wal/RECOVERYXLOG"); | ||||
|   | ||||
| @@ -31,8 +31,8 @@ testRun(void) | ||||
|         // Load Parameters | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptArchiveTimeout, ".5"); | ||||
|         HRN_CFG_LOAD(cfgCmdCheck, argList); | ||||
|  | ||||
| @@ -58,7 +58,7 @@ testRun(void) | ||||
|  | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH_PG, true, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH "/pg", true, NULL, NULL), | ||||
|             HRNPQ_MACRO_CLOSE(1), | ||||
|             HRNPQ_MACRO_DONE() | ||||
|         }); | ||||
| @@ -70,10 +70,10 @@ testRun(void) | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 8, "/path/to/standby2"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPort, 8, "5433"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoHost, 2, "repo.domain.com"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptArchiveTimeout, ".5"); | ||||
|         HRN_CFG_LOAD(cfgCmdCheck, argList); | ||||
| @@ -98,7 +98,7 @@ testRun(void) | ||||
|         // Standby only, repo remote but only one pg-path configured | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoHost, 1, "repo.domain.com"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptArchiveTimeout, ".5"); | ||||
|         HRN_CFG_LOAD(cfgCmdCheck, argList); | ||||
| @@ -112,15 +112,15 @@ testRun(void) | ||||
|  | ||||
|         // Only confirming we get passed the check for repoIsLocal || more than one pg-path configured | ||||
|         TEST_ERROR( | ||||
|             cmdCheck(), FileMissingError, "unable to open missing file '" TEST_PATH_PG "/global/pg_control' for read"); | ||||
|             cmdCheck(), FileMissingError, "unable to open missing file '" TEST_PATH "/pg/global/pg_control' for read"); | ||||
|  | ||||
|         //-------------------------------------------------------------------------------------------------------------------------- | ||||
|         TEST_TITLE("backup-standby set without standby"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptArchiveTimeout, ".5"); | ||||
|         hrnCfgArgRawBool(argList, cfgOptBackupStandby, true); | ||||
|         HRN_CFG_LOAD(cfgCmdCheck, argList); | ||||
| @@ -128,13 +128,13 @@ testRun(void) | ||||
|         // Primary database connection ok | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH_PG, false, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH "/pg", false, NULL, NULL), | ||||
|             HRNPQ_MACRO_CLOSE(1), | ||||
|             HRNPQ_MACRO_DONE() | ||||
|         }); | ||||
|  | ||||
|         TEST_ERROR( | ||||
|             cmdCheck(), FileMissingError, "unable to open missing file '" TEST_PATH_PG "/global/pg_control' for read"); | ||||
|             cmdCheck(), FileMissingError, "unable to open missing file '" TEST_PATH "/pg/global/pg_control' for read"); | ||||
|         TEST_RESULT_LOG("P00   WARN: option 'backup-standby' is enabled but standby is not properly configured"); | ||||
|  | ||||
|         //-------------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -142,8 +142,8 @@ testRun(void) | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptArchiveTimeout, ".5"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 8, TEST_PATH "/pg8"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPort, 8, "5433"); | ||||
| @@ -169,7 +169,7 @@ testRun(void) | ||||
|         TEST_ERROR( | ||||
|             cmdCheck(), DbMismatchError, | ||||
|             "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 "/global/pg_control'\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."); | ||||
|  | ||||
|         //-------------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -206,7 +206,7 @@ testRun(void) | ||||
|         // Single repo config - error when checking archive mode setting on database | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH_PG, true, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH "/pg", true, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(8, "dbname='postgres' port=5433", PG_VERSION_92, TEST_PATH "/pg8", false, "off", NULL), | ||||
|  | ||||
|             HRNPQ_MACRO_CLOSE(1), | ||||
| @@ -231,7 +231,7 @@ testRun(void) | ||||
|  | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH_PG, true, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH "/pg", true, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(8, "dbname='postgres' port=5433", PG_VERSION_92, TEST_PATH "/pg8", false, NULL, NULL), | ||||
|  | ||||
|             HRNPQ_MACRO_CLOSE(8), | ||||
| @@ -261,8 +261,8 @@ testRun(void) | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 2, TEST_PATH "/repo2"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptArchiveTimeout, ".5"); | ||||
|         HRN_CFG_LOAD(cfgCmdCheck, argList); | ||||
| @@ -293,7 +293,7 @@ testRun(void) | ||||
|         // Error when WAL segment not found | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH_PG, false, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH "/pg", false, NULL, NULL), | ||||
|             HRNPQ_MACRO_CREATE_RESTORE_POINT(1, "1/1"), | ||||
|             HRNPQ_MACRO_WAL_SWITCH(1, "xlog", "000000010000000100000001"), | ||||
|             HRNPQ_MACRO_CLOSE(1), | ||||
| @@ -322,7 +322,7 @@ testRun(void) | ||||
|         // WAL segment switch is performed once for all repos | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH_PG, false, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH "/pg", false, NULL, NULL), | ||||
|             HRNPQ_MACRO_CREATE_RESTORE_POINT(1, "1/1"), | ||||
|             HRNPQ_MACRO_WAL_SWITCH(1, "xlog", "000000010000000100000001"), | ||||
|             HRNPQ_MACRO_CLOSE(1), | ||||
| @@ -341,7 +341,7 @@ testRun(void) | ||||
|             "P00   INFO: check repo1 configuration (primary)\n" | ||||
|             "P00   INFO: check repo2 configuration (primary)\n" | ||||
|             "P00   INFO: check repo1 archive for WAL (primary)\n" | ||||
|             "P00   INFO: WAL segment 000000010000000100000001 successfully archived to '" TEST_PATH_REPO "/archive/test1/9.2-1/" | ||||
|             "P00   INFO: WAL segment 000000010000000100000001 successfully archived to '" TEST_PATH "/repo/archive/test1/9.2-1/" | ||||
|                 "0000000100000001/000000010000000100000001-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' on repo1\n" | ||||
|             "P00   INFO: check repo2 archive for WAL (primary)\n" | ||||
|             "P00   INFO: WAL segment 000000010000000100000001 successfully archived to '" TEST_PATH "/repo2/archive/test1/9.2-1/" | ||||
| @@ -359,7 +359,7 @@ testRun(void) | ||||
|     { | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgHost, 5, "localhost"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgHostCmd, 5, "pgbackrest-bogus"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 5, "/path/to/pg5"); | ||||
| @@ -396,17 +396,17 @@ testRun(void) | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 8, TEST_PATH "/pg8"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPort, 8, "5433"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         HRN_CFG_LOAD(cfgCmdCheck, argList); | ||||
|  | ||||
|         DbGetResult db = {0}; | ||||
|  | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH_PG, false, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH "/pg", false, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(8, "dbname='postgres' port=5433", PG_VERSION_92, "/badpath", true, NULL, NULL), | ||||
|  | ||||
|             HRNPQ_MACRO_CLOSE(1), | ||||
| @@ -423,8 +423,8 @@ testRun(void) | ||||
|  | ||||
|         TEST_ERROR( | ||||
|             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 '" | ||||
|             PG_VERSION_94_STR "' and '" TEST_PATH_PG "' read from '" TEST_PATH_PG "/global/pg_control'\n" | ||||
|             "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/global/pg_control'\n" | ||||
|             "HINT: the pg1-path and pg1-port settings likely reference different clusters."); | ||||
|  | ||||
|         //-------------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -450,10 +450,10 @@ testRun(void) | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 8, TEST_PATH "/pg8"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPort, 8, "5433"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         HRN_CFG_LOAD(cfgCmdStanzaCreate, argList); | ||||
|  | ||||
|         TEST_RESULT_VOID( | ||||
| @@ -467,13 +467,13 @@ testRun(void) | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         HRN_CFG_LOAD(cfgCmdCheck, argList); | ||||
|  | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH_PG, false, "always", NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH "/pg", false, "always", NULL), | ||||
|             HRNPQ_MACRO_CLOSE(1), | ||||
|             HRNPQ_MACRO_DONE() | ||||
|         }); | ||||
| @@ -565,8 +565,8 @@ testRun(void) | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawBool(argList, cfgOptOnline, false); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, "test1"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         hrnCfgEnvKeyRawZ(cfgOptRepoCipherPass, 1, TEST_CIPHER_PASS); | ||||
|         HRN_CFG_LOAD(cfgCmdStanzaCreate, argList); | ||||
|   | ||||
| @@ -72,7 +72,7 @@ testRun(void) | ||||
|  | ||||
|     StringList *argListBase = strLstNew(); | ||||
|     hrnCfgArgRawZ(argListBase, cfgOptStanza, "db"); | ||||
|     hrnCfgArgRawZ(argListBase, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|     hrnCfgArgRawZ(argListBase, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|  | ||||
|     // Initialize a configuration list that avoids the retention warning | ||||
|     StringList *argListAvoidWarn = strLstDup(argListBase); | ||||
| @@ -799,7 +799,7 @@ testRun(void) | ||||
|  | ||||
|         // Copy the repo to another repo | ||||
|         HRN_SYSTEM("mkdir " TEST_PATH "/repo2"); | ||||
|         HRN_SYSTEM("cp -r " TEST_PATH_REPO "/* " TEST_PATH "/repo2/"); | ||||
|         HRN_SYSTEM("cp -r " TEST_PATH "/repo/* " TEST_PATH "/repo2/"); | ||||
|  | ||||
|         // Configure multi-repo and set the repo option to expire the second repo (non-default) files | ||||
|         argList = strLstDup(argListBase); | ||||
| @@ -815,7 +815,7 @@ testRun(void) | ||||
|  | ||||
|         StringList *argList2 = strLstDup(argList); | ||||
|         hrnCfgArgRawZ(argList2, cfgOptRepo, "2"); | ||||
|         hrnCfgArgRawZ(argList2, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList2, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         HRN_CFG_LOAD(cfgCmdBackup, argList2); | ||||
|  | ||||
|         TEST_RESULT_VOID(cmdExpire(), "via backup command: expire last backup in archive sub path and remove sub path"); | ||||
| @@ -883,10 +883,10 @@ testRun(void) | ||||
|  | ||||
|         // Rename backup.info files on repo1 to cause error | ||||
|         HRN_STORAGE_MOVE( | ||||
|             storageTest, TEST_PATH_REPO "/backup/db/" INFO_BACKUP_FILE, TEST_PATH_REPO "/backup/db/" INFO_BACKUP_FILE ".save"); | ||||
|             storageTest, TEST_PATH "/repo/backup/db/" INFO_BACKUP_FILE, TEST_PATH "/repo/backup/db/" INFO_BACKUP_FILE ".save"); | ||||
|         HRN_STORAGE_MOVE( | ||||
|             storageTest, TEST_PATH_REPO "/backup/db/" INFO_BACKUP_FILE INFO_COPY_EXT, | ||||
|             TEST_PATH_REPO "/backup/db/" INFO_BACKUP_FILE INFO_COPY_EXT ".save"); | ||||
|             storageTest, TEST_PATH "/repo/backup/db/" INFO_BACKUP_FILE INFO_COPY_EXT, | ||||
|             TEST_PATH "/repo/backup/db/" INFO_BACKUP_FILE INFO_COPY_EXT ".save"); | ||||
|  | ||||
|         // Rename archive.info file on repo2 to cause error | ||||
|         HRN_STORAGE_MOVE( | ||||
| @@ -901,10 +901,10 @@ testRun(void) | ||||
|         TEST_ERROR( | ||||
|             cmdExpire(), CommandError, CFGCMD_EXPIRE " command encountered 2 error(s), check the log file for details"); | ||||
|         TEST_RESULT_LOG( | ||||
|             "P00  ERROR: [055]: [DRY-RUN] repo1: unable to load info file '" TEST_PATH_REPO "/backup/db/backup.info' or '" | ||||
|                          TEST_PATH_REPO "/backup/db/backup.info.copy':\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/db/backup.info' for read\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/db/backup.info.copy' for read\n" | ||||
|             "P00  ERROR: [055]: [DRY-RUN] repo1: unable to load info file '" TEST_PATH "/repo/backup/db/backup.info' or '" | ||||
|                          TEST_PATH "/repo/backup/db/backup.info.copy':\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH "/repo/backup/db/backup.info' for read\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH "/repo/backup/db/backup.info.copy' for read\n" | ||||
|             "            HINT: backup.info cannot be opened and is required to perform a backup.\n" | ||||
|             "            HINT: has a stanza-create been performed?\n" | ||||
|             "P00   INFO: [DRY-RUN] repo2: expire diff backup set 20181119-152800F_20181119-152152D," | ||||
| @@ -931,10 +931,10 @@ testRun(void) | ||||
|         TEST_ERROR( | ||||
|             cmdExpire(), CommandError, CFGCMD_EXPIRE " command encountered 1 error(s), check the log file for details"); | ||||
|         TEST_RESULT_LOG( | ||||
|             "P00  ERROR: [055]: [DRY-RUN] repo1: unable to load info file '" TEST_PATH_REPO "/backup/db/backup.info' or '" | ||||
|                          TEST_PATH_REPO "/backup/db/backup.info.copy':\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/db/backup.info' for read\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/db/backup.info.copy' for read\n" | ||||
|             "P00  ERROR: [055]: [DRY-RUN] repo1: unable to load info file '" TEST_PATH "/repo/backup/db/backup.info' or '" | ||||
|                          TEST_PATH "/repo/backup/db/backup.info.copy':\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH "/repo/backup/db/backup.info' for read\n" | ||||
|             "            FileMissingError: unable to open missing file '" TEST_PATH "/repo/backup/db/backup.info.copy' for read\n" | ||||
|             "            HINT: backup.info cannot be opened and is required to perform a backup.\n" | ||||
|             "            HINT: has a stanza-create been performed?\n" | ||||
|             "P00   INFO: [DRY-RUN] repo2: expire diff backup set 20181119-152800F_20181119-152152D," | ||||
| @@ -952,10 +952,10 @@ testRun(void) | ||||
|  | ||||
|         // Restore saved backup.info files | ||||
|         HRN_STORAGE_MOVE( | ||||
|             storageTest, TEST_PATH_REPO "/backup/db/" INFO_BACKUP_FILE ".save", TEST_PATH_REPO "/backup/db/" INFO_BACKUP_FILE); | ||||
|             storageTest, TEST_PATH "/repo/backup/db/" INFO_BACKUP_FILE ".save", TEST_PATH "/repo/backup/db/" INFO_BACKUP_FILE); | ||||
|         HRN_STORAGE_MOVE( | ||||
|             storageTest, TEST_PATH_REPO "/backup/db/" INFO_BACKUP_FILE INFO_COPY_EXT ".save", | ||||
|             TEST_PATH_REPO "/backup/db/" INFO_BACKUP_FILE INFO_COPY_EXT); | ||||
|             storageTest, TEST_PATH "/repo/backup/db/" INFO_BACKUP_FILE INFO_COPY_EXT ".save", | ||||
|             TEST_PATH "/repo/backup/db/" INFO_BACKUP_FILE INFO_COPY_EXT); | ||||
|  | ||||
|         //-------------------------------------------------------------------------------------------------------------------------- | ||||
|         TEST_TITLE("expire command - multi-repo, dry run: archive and backups not removed"); | ||||
| @@ -1007,7 +1007,7 @@ testRun(void) | ||||
|             "P00   INFO: [DRY-RUN] repo1: remove expired backup 20181119-152800F_20181119-152155I\n" | ||||
|             "P00   INFO: [DRY-RUN] repo1: remove expired backup 20181119-152800F_20181119-152152D\n" | ||||
|             "P00   INFO: [DRY-RUN] repo1: remove expired backup 20181119-152800F\n" | ||||
|             "P00   INFO: [DRY-RUN] repo1: remove archive path " TEST_PATH_REPO "/archive/db/9.4-1\n" | ||||
|             "P00   INFO: [DRY-RUN] repo1: remove archive path " TEST_PATH "/repo/archive/db/9.4-1\n" | ||||
|             "P00 DETAIL: [DRY-RUN] repo1: 10-2 archive retention on backup 20181119-152900F, start = 000000010000000000000003\n" | ||||
|             "P00   INFO: [DRY-RUN] repo1: 10-2 no archive to remove\n" | ||||
|             "P00   INFO: [DRY-RUN] repo2: expire diff backup set 20181119-152800F_20181119-152152D," | ||||
| @@ -1052,7 +1052,7 @@ testRun(void) | ||||
|             "P00   INFO: repo1: remove expired backup 20181119-152800F_20181119-152155I\n" | ||||
|             "P00   INFO: repo1: remove expired backup 20181119-152800F_20181119-152152D\n" | ||||
|             "P00   INFO: repo1: remove expired backup 20181119-152800F\n" | ||||
|             "P00   INFO: repo1: remove archive path " TEST_PATH_REPO "/archive/db/9.4-1\n" | ||||
|             "P00   INFO: repo1: remove archive path " TEST_PATH "/repo/archive/db/9.4-1\n" | ||||
|             "P00 DETAIL: repo1: 10-2 archive retention on backup 20181119-152900F, start = 000000010000000000000003\n" | ||||
|             "P00   INFO: repo1: 10-2 no archive to remove\n" | ||||
|             "P00   INFO: repo2: expire diff backup set 20181119-152800F_20181119-152152D," | ||||
| @@ -1142,12 +1142,12 @@ testRun(void) | ||||
|         archiveGenerate(storageRepoWrite(), STORAGE_REPO_ARCHIVE, 1, 1, "9.4-1", "0000000100000000"); | ||||
|         argList = strLstDup(argListAvoidWarn); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoRetentionArchive, "1"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         HRN_CFG_LOAD(cfgCmdBackup, argList); | ||||
|  | ||||
|         TEST_RESULT_VOID(cmdExpire(), "expire remove archive path"); | ||||
|         TEST_RESULT_LOG( | ||||
|             "P00   INFO: repo1: remove archive path " TEST_PATH_REPO "/archive/db/9.4-1\n" | ||||
|             "P00   INFO: repo1: remove archive path " TEST_PATH "/repo/archive/db/9.4-1\n" | ||||
|             "P00   INFO: repo1: 10-2 no archive to remove"); | ||||
|  | ||||
|         //-------------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -1338,7 +1338,7 @@ testRun(void) | ||||
|         // Load Parameters | ||||
|         argList = strLstDup(argListBase); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoRetentionFull, "2"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         HRN_CFG_LOAD(cfgCmdBackup, argList); | ||||
|  | ||||
|         // Restore the history file | ||||
| @@ -1457,7 +1457,7 @@ testRun(void) | ||||
|         // Add one year old full backup | ||||
|         HRN_STORAGE_PUT_EMPTY(storageRepoWrite(), STORAGE_REPO_BACKUP "/backup.history/2017/20171119-152138F.manifest.gz"); | ||||
|  | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         HRN_CFG_LOAD(cfgCmdBackup, argList); | ||||
|  | ||||
|         TEST_RESULT_VOID(cmdExpire(), "expire"); | ||||
| @@ -1811,7 +1811,7 @@ testRun(void) | ||||
|             "option-online=false\n" | ||||
|             "\n" | ||||
|             "[backup:target]\n" | ||||
|             "pg_data={\"path\":\"" TEST_PATH_PG "\",\"type\":\"path\"}\n" | ||||
|             "pg_data={\"path\":\"" TEST_PATH "/pg\",\"type\":\"path\"}\n" | ||||
|             "\n" | ||||
|             "[db]\n" | ||||
|             "postgres={\"db-id\":12980,\"db-last-system-id\":12979}\n" | ||||
| @@ -2015,7 +2015,7 @@ testRun(void) | ||||
|             "P00   INFO: repo1: expire adhoc backup set 20181119-152800F, 20181119-152800F_20181119-152252D\n" | ||||
|             "P00   INFO: repo1: remove expired backup 20181119-152800F_20181119-152252D\n" | ||||
|             "P00   INFO: repo1: remove expired backup 20181119-152800F\n" | ||||
|             "P00   INFO: repo1: remove archive path " TEST_PATH_REPO "/archive/db/9.4-1\n" | ||||
|             "P00   INFO: repo1: remove archive path " TEST_PATH "/repo/archive/db/9.4-1\n" | ||||
|             "P00 DETAIL: repo1: 12-2 archive retention on backup 20181119-152850F, start = 000000010000000000000002\n" | ||||
|             "P00   INFO: repo1: 12-2 no archive to remove"); | ||||
|  | ||||
| @@ -2174,7 +2174,7 @@ testRun(void) | ||||
|                 "option-online=false\n" | ||||
|                 "\n" | ||||
|                 "[backup:target]\n" | ||||
|                 "pg_data={\"path\":\"" TEST_PATH_PG "\",\"type\":\"path\"}\n" | ||||
|                 "pg_data={\"path\":\"" TEST_PATH "/pg\",\"type\":\"path\"}\n" | ||||
|                 "\n" | ||||
|                 "[db]\n" | ||||
|                 "postgres={\"db-id\":12980,\"db-last-system-id\":12979}\n" | ||||
|   | ||||
| @@ -28,7 +28,7 @@ testRun(void) | ||||
|     if (testBegin("infoRender()")) | ||||
|     { | ||||
|         StringList *argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         StringList *argListText = strLstDup(argList); | ||||
|  | ||||
|         hrnCfgArgRawZ(argList, cfgOptOutput, "json"); | ||||
| @@ -132,7 +132,7 @@ testRun(void) | ||||
|  | ||||
|         // Put backup info to file | ||||
|         HRN_INFO_PUT( | ||||
|             storageTest, TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/stanza1/" INFO_BACKUP_FILE, | ||||
|             storageTest, TEST_PATH "/repo/" STORAGE_PATH_BACKUP "/stanza1/" INFO_BACKUP_FILE, | ||||
|             "[db]\n" | ||||
|             "db-catalog-version=201409291\n" | ||||
|             "db-control-version=942\n" | ||||
| @@ -162,12 +162,12 @@ testRun(void) | ||||
|                             "\"status\":{" | ||||
|                                 "\"code\":99," | ||||
|                                 "\"message\":\"[FileMissingError] unable to load info file '" | ||||
|                                 TEST_PATH_REPO "/archive/stanza1/archive.info' or '" | ||||
|                                 TEST_PATH_REPO "/archive/stanza1/archive.info.copy':\\n" | ||||
|                                 "FileMissingError: unable to open missing file '" TEST_PATH_REPO "/archive/stanza1/archive.info'" | ||||
|                                 TEST_PATH "/repo/archive/stanza1/archive.info' or '" | ||||
|                                 TEST_PATH "/repo/archive/stanza1/archive.info.copy':\\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 | ||||
|                                 "/archive/stanza1/archive.info.copy' for read\\n" | ||||
|                                 "FileMissingError: unable to open missing file '" TEST_PATH | ||||
|                                 "/repo/archive/stanza1/archive.info.copy' for read\\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: has a stanza-create been performed?\\n" | ||||
| @@ -190,10 +190,10 @@ testRun(void) | ||||
|             infoRender(), | ||||
|             "stanza: stanza1\n" | ||||
|             "    status: error (other)\n" | ||||
|             "            [FileMissingError] unable to load info file '" TEST_PATH_REPO "/archive/stanza1/archive.info' or '" | ||||
|                          TEST_PATH_REPO "/archive/stanza1/archive.info.copy':\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 "/archive/stanza1/archive.info.copy'" | ||||
|             "            [FileMissingError] unable to load info file '" TEST_PATH "/repo/archive/stanza1/archive.info' or '" | ||||
|                          TEST_PATH "/repo/archive/stanza1/archive.info.copy':\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/archive/stanza1/archive.info.copy'" | ||||
|                          " for read\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" | ||||
| @@ -594,8 +594,8 @@ testRun(void) | ||||
|         HARNESS_FORK_END(); | ||||
|  | ||||
|         // Cleanup | ||||
|         HRN_STORAGE_PATH_REMOVE(storageTest, TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "/stanza1/9.3-2", .recurse = true); | ||||
|         HRN_STORAGE_PATH_REMOVE(storageTest, TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "/stanza1/9.4-3", .recurse = true); | ||||
|         HRN_STORAGE_PATH_REMOVE(storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE "/stanza1/9.3-2", .recurse = true); | ||||
|         HRN_STORAGE_PATH_REMOVE(storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE "/stanza1/9.4-3", .recurse = true); | ||||
|  | ||||
|         // backup.info/archive.info files exist, backups exist, archives exist, multi-repo (mixed) with one stanza existing on both | ||||
|         // repos and the db history is different between the repos | ||||
| @@ -603,7 +603,7 @@ testRun(void) | ||||
|         TEST_TITLE("mixed multi-repo"); | ||||
|  | ||||
|         HRN_INFO_PUT( | ||||
|             storageTest, TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "/stanza1/" INFO_ARCHIVE_FILE, | ||||
|             storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE "/stanza1/" INFO_ARCHIVE_FILE, | ||||
|             "[db]\n" | ||||
|             "db-id=2\n" | ||||
|             "db-system-id=6626363367545678089\n" | ||||
| @@ -615,7 +615,7 @@ testRun(void) | ||||
|             .comment = "put archive info to file - stanza1, repo1"); | ||||
|  | ||||
|         HRN_INFO_PUT( | ||||
|             storageTest, TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/stanza1/" INFO_BACKUP_FILE, | ||||
|             storageTest, TEST_PATH "/repo/" STORAGE_PATH_BACKUP "/stanza1/" INFO_BACKUP_FILE, | ||||
|             "[backup:current]\n" | ||||
|             "20181119-152138F={" | ||||
|             "\"backrest-format\":5,\"backrest-version\":\"2.08dev\"," | ||||
| @@ -780,7 +780,7 @@ testRun(void) | ||||
|             "user=\"user1\"\n" | ||||
|  | ||||
|         HRN_INFO_PUT( | ||||
|             storageTest, TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/stanza1/20181119-152138F_20181119-152155I/" BACKUP_MANIFEST_FILE, | ||||
|             storageTest, TEST_PATH "/repo/" STORAGE_PATH_BACKUP "/stanza1/20181119-152138F_20181119-152155I/" BACKUP_MANIFEST_FILE, | ||||
|             TEST_MANIFEST_HEADER | ||||
|             TEST_MANIFEST_TARGET | ||||
|             TEST_MANIFEST_DB | ||||
| @@ -793,7 +793,7 @@ testRun(void) | ||||
|             .comment = "write manifest - stanza1, repo1"); | ||||
|  | ||||
|         HRN_INFO_PUT( | ||||
|             storageTest, TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE "/stanza2/" INFO_ARCHIVE_FILE, | ||||
|             storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE "/stanza2/" INFO_ARCHIVE_FILE, | ||||
|             "[db]\n" | ||||
|             "db-id=1\n" | ||||
|             "db-system-id=6625633699176220261\n" | ||||
| @@ -803,7 +803,7 @@ testRun(void) | ||||
|             "1={\"db-id\":6625633699176220261,\"db-version\":\"9.4\"}\n", | ||||
|             .comment = "put archive info to file - stanza2, repo1"); | ||||
|         HRN_INFO_PUT( | ||||
|             storageTest, TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/stanza2/" INFO_BACKUP_FILE, | ||||
|             storageTest, TEST_PATH "/repo/" STORAGE_PATH_BACKUP "/stanza2/" INFO_BACKUP_FILE, | ||||
|             "[db]\n" | ||||
|             "db-catalog-version=201409291\n" | ||||
|             "db-control-version=942\n" | ||||
| @@ -860,16 +860,16 @@ testRun(void) | ||||
|  | ||||
|         // Add WAL on repo1 and encrypted repo2 for stanza1 | ||||
|         HRN_STORAGE_PUT_EMPTY( | ||||
|             storageTest, TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE | ||||
|             storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE | ||||
|             "/stanza1/9.5-2/0000000100000000/000000010000000000000002-ac61b8f1ec7b1e6c3eaee9345214595eb7daa9a1.gz"); | ||||
|         HRN_STORAGE_PUT_EMPTY( | ||||
|             storageTest, TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE | ||||
|             storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE | ||||
|             "/stanza1/9.5-2/0000000100000000/000000010000000000000003-37dff2b7552a9d66e4bae1a762488a6885e7082c.gz"); | ||||
|         HRN_STORAGE_PUT_EMPTY( | ||||
|             storageTest, TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE | ||||
|             storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE | ||||
|             "/stanza1/9.5-2/0000000100000000/000000010000000000000004-ee61b8f1ec7b1e6c3eaee9345214595eb7daa9a1.gz"); | ||||
|         HRN_STORAGE_PUT_EMPTY( | ||||
|             storageTest, TEST_PATH_REPO "/" STORAGE_PATH_ARCHIVE | ||||
|             storageTest, TEST_PATH "/repo/" STORAGE_PATH_ARCHIVE | ||||
|             "/stanza1/9.5-2/0000000100000000/000000010000000000000005-abc123f1ec7b1e6c3eaee9345214595eb7daa9a1.gz"); | ||||
|  | ||||
|         HRN_STORAGE_PUT_EMPTY( | ||||
| @@ -981,7 +981,7 @@ testRun(void) | ||||
|  | ||||
|         // Set up the configuration | ||||
|         StringList *argListMultiRepo = strLstNew(); | ||||
|         hrnCfgArgRawZ(argListMultiRepo, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argListMultiRepo, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgKeyRawZ(argListMultiRepo, cfgOptRepoPath, 2, TEST_PATH "/repo2"); | ||||
|         hrnCfgArgKeyRawStrId(argListMultiRepo, cfgOptRepoCipherType, 2, cipherTypeAes256Cbc); | ||||
|         hrnCfgEnvKeyRawZ(cfgOptRepoCipherPass, 2, TEST_CIPHER_PASS); | ||||
| @@ -2246,11 +2246,11 @@ testRun(void) | ||||
|             "stanza: stanza1\n" | ||||
|             "    status: mixed\n" | ||||
|             "        repo1: error (other)\n" | ||||
|             "               [CryptoError] unable to load info file '" TEST_PATH_REPO "/backup/stanza1/backup.info' or '" | ||||
|                             TEST_PATH_REPO "/backup/stanza1/backup.info.copy':\n" | ||||
|             "               [CryptoError] unable to load info file '" TEST_PATH "/repo/backup/stanza1/backup.info' or '" | ||||
|                             TEST_PATH "/repo/backup/stanza1/backup.info.copy':\n" | ||||
|             "               CryptoError: cipher header invalid\n" | ||||
|             "               HINT: is or was the repo encrypted?\n" | ||||
|             "               FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/stanza1/backup.info.copy'" | ||||
|             "               FileMissingError: unable to open missing file '" TEST_PATH "/repo/backup/stanza1/backup.info.copy'" | ||||
|                             " for read\n" | ||||
|             "               HINT: backup.info cannot be opened and is required to perform a backup.\n" | ||||
|             "               HINT: has a stanza-create been performed?\n" | ||||
| @@ -2265,11 +2265,11 @@ testRun(void) | ||||
|             "stanza: stanza2\n" | ||||
|             "    status: mixed\n" | ||||
|             "        repo1: error (other)\n" | ||||
|             "               [CryptoError] unable to load info file '" TEST_PATH_REPO "/backup/stanza2/backup.info' or '" | ||||
|                             TEST_PATH_REPO "/backup/stanza2/backup.info.copy':\n" | ||||
|             "               [CryptoError] unable to load info file '" TEST_PATH "/repo/backup/stanza2/backup.info' or '" | ||||
|                             TEST_PATH "/repo/backup/stanza2/backup.info.copy':\n" | ||||
|             "               CryptoError: cipher header invalid\n" | ||||
|             "               HINT: is or was the repo encrypted?\n" | ||||
|             "               FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/stanza2/backup.info.copy'" | ||||
|             "               FileMissingError: unable to open missing file '" TEST_PATH "/repo/backup/stanza2/backup.info.copy'" | ||||
|                             " for read\n" | ||||
|             "               HINT: backup.info cannot be opened and is required to perform a backup.\n" | ||||
|             "               HINT: has a stanza-create been performed?\n" | ||||
| @@ -2281,11 +2281,11 @@ testRun(void) | ||||
|             "stanza: stanza3\n" | ||||
|             "    status: mixed\n" | ||||
|             "        repo1: error (other)\n" | ||||
|             "               [CryptoError] unable to load info file '" TEST_PATH_REPO "/backup/stanza3/backup.info' or '" | ||||
|                             TEST_PATH_REPO "/backup/stanza3/backup.info.copy':\n" | ||||
|             "               [CryptoError] unable to load info file '" TEST_PATH "/repo/backup/stanza3/backup.info' or '" | ||||
|                             TEST_PATH "/repo/backup/stanza3/backup.info.copy':\n" | ||||
|             "               CryptoError: cipher header invalid\n" | ||||
|             "               HINT: is or was the repo encrypted?\n" | ||||
|             "               FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/stanza3/backup.info.copy'" | ||||
|             "               FileMissingError: unable to open missing file '" TEST_PATH "/repo/backup/stanza3/backup.info.copy'" | ||||
|                             " for read\n" | ||||
|             "               HINT: backup.info cannot be opened and is required to perform a backup.\n" | ||||
|             "               HINT: has a stanza-create been performed?\n" | ||||
| @@ -2317,11 +2317,11 @@ testRun(void) | ||||
|             "stanza: stanza3\n" | ||||
|             "    status: mixed\n" | ||||
|             "        repo1: error (other)\n" | ||||
|             "               [CryptoError] unable to load info file '" TEST_PATH_REPO "/backup/stanza3/backup.info' or '" | ||||
|                             TEST_PATH_REPO "/backup/stanza3/backup.info.copy':\n" | ||||
|             "               [CryptoError] unable to load info file '" TEST_PATH "/repo/backup/stanza3/backup.info' or '" | ||||
|                             TEST_PATH "/repo/backup/stanza3/backup.info.copy':\n" | ||||
|             "               CryptoError: cipher header invalid\n" | ||||
|             "               HINT: is or was the repo encrypted?\n" | ||||
|             "               FileMissingError: unable to open missing file '" TEST_PATH_REPO "/backup/stanza3/backup.info.copy'" | ||||
|             "               FileMissingError: unable to open missing file '" TEST_PATH "/repo/backup/stanza3/backup.info.copy'" | ||||
|                             " for read\n" | ||||
|             "               HINT: backup.info cannot be opened and is required to perform a backup.\n" | ||||
|             "               HINT: has a stanza-create been performed?\n" | ||||
| @@ -2347,7 +2347,7 @@ testRun(void) | ||||
|             "stanza: stanza1\n" | ||||
|             "    status: mixed\n" | ||||
|             "        repo1: error (other)\n" | ||||
|             "               [PathOpenError] unable to list file info for path '" TEST_PATH_REPO "/archive/stanza1/9.4-1': [13]" | ||||
|             "               [PathOpenError] unable to list file info for path '" TEST_PATH "/repo/archive/stanza1/9.4-1': [13]" | ||||
|             " Permission denied\n" | ||||
|             "        repo2: error (no valid backups)\n" | ||||
|             "    cipher: mixed\n" | ||||
| @@ -2369,7 +2369,7 @@ testRun(void) | ||||
|         TEST_TITLE("multi-repo, database mismatch, pg system-id only"); | ||||
|  | ||||
|         StringList *argList2 = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList2, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList2, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawZ(argList2, cfgOptStanza, "stanza1"); | ||||
|         hrnCfgArgKeyRawZ(argList2, cfgOptRepoPath, 2, TEST_PATH "/repo2"); | ||||
|         HRN_CFG_LOAD(cfgCmdInfo, argList2); | ||||
| @@ -2558,7 +2558,7 @@ testRun(void) | ||||
|     if (testBegin("cmdInfo()")) | ||||
|     { | ||||
|         StringList *argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         HRN_CFG_LOAD(cfgCmdInfo, argList); | ||||
|  | ||||
|         HRN_STORAGE_PATH_CREATE(storageRepoWrite(), STORAGE_REPO_ARCHIVE, .comment = "create repo archive path"); | ||||
|   | ||||
| @@ -26,7 +26,7 @@ testRun(void) | ||||
|     if (testBegin("cmdRepoCreate()")) | ||||
|     { | ||||
|         StringList *argList = strLstNew(); | ||||
|         strLstAddZ(argList, "--repo-path=" TEST_PATH_REPO); | ||||
|         strLstAddZ(argList, "--repo-path=" TEST_PATH "/repo"); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoCreate, argList); | ||||
|  | ||||
|         // ------------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -39,7 +39,7 @@ testRun(void) | ||||
|     if (testBegin("cmdStorageList() and storageListRender()")) | ||||
|     { | ||||
|         StringList *argList = strLstNew(); | ||||
|         strLstAddZ(argList, "--repo-path=" TEST_PATH_REPO); | ||||
|         strLstAddZ(argList, "--repo-path=" TEST_PATH "/repo"); | ||||
|         strLstAddZ(argList, "--output=text"); | ||||
|         strLstAddZ(argList, "--sort=none"); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoLs, argList); | ||||
| @@ -191,7 +191,7 @@ testRun(void) | ||||
|         // ------------------------------------------------------------------------------------------------------------------------- | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 1, TEST_PATH "/bogus"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 2, TEST_PATH_REPO "/aaa"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 2, TEST_PATH "/repo/aaa"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepo, "2"); | ||||
|         strLstAddZ(argList, "--output=json"); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoLs, argList); | ||||
| @@ -297,7 +297,7 @@ testRun(void) | ||||
|         TEST_TITLE("error when missing destination"); | ||||
|  | ||||
|         StringList *argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoPut, argList); | ||||
|  | ||||
|         TEST_ERROR(storagePutProcess(ioBufferReadNew(fileBuffer)), ParamRequiredError, "destination file required"); | ||||
| @@ -314,7 +314,7 @@ testRun(void) | ||||
|         TEST_TITLE("put an encrypted file with custom key"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, "--" CFGOPT_CIPHER_PASS "=custom"); | ||||
|         strLstAdd(argList, fileEncCustomName); | ||||
| @@ -326,7 +326,7 @@ testRun(void) | ||||
|         TEST_TITLE("put a raw file"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, "--raw"); | ||||
|         strLstAdd(argList, fileRawName); | ||||
| @@ -348,7 +348,7 @@ testRun(void) | ||||
|         TEST_TITLE("put encrypted archive.info"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, STORAGE_PATH_ARCHIVE "/test/" INFO_ARCHIVE_FILE); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoPut, argList); | ||||
| @@ -359,7 +359,7 @@ testRun(void) | ||||
|         TEST_TITLE("put encrypted archive.info.copy"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, STORAGE_PATH_ARCHIVE "/test/" INFO_ARCHIVE_FILE ".copy"); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoPut, argList); | ||||
| @@ -370,7 +370,7 @@ testRun(void) | ||||
|         TEST_TITLE("put encrypted backup.info"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, STORAGE_PATH_BACKUP "/test/" INFO_BACKUP_FILE); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoPut, argList); | ||||
| @@ -381,7 +381,7 @@ testRun(void) | ||||
|         TEST_TITLE("put encrypted backup.info.copy"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, STORAGE_PATH_BACKUP "/test/" INFO_BACKUP_FILE ".copy"); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoPut, argList); | ||||
| @@ -398,7 +398,7 @@ testRun(void) | ||||
|         bufUsedSet(archiveFileBuffer, bufSize(archiveFileBuffer)); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, "--" CFGOPT_CIPHER_PASS "=custom"); | ||||
|         strLstAdd( | ||||
| @@ -414,7 +414,7 @@ testRun(void) | ||||
|         TEST_TITLE("put encrypted backup.manifest"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, "--" CFGOPT_CIPHER_PASS "=custom"); | ||||
|         strLstAddZ(argList, STORAGE_PATH_BACKUP "/test/latest/" BACKUP_MANIFEST_FILE); | ||||
| @@ -426,7 +426,7 @@ testRun(void) | ||||
|         TEST_TITLE("put encrypted backup.manifest.copy"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, "--" CFGOPT_CIPHER_PASS "=custom"); | ||||
|         strLstAddZ(argList, STORAGE_PATH_BACKUP "/test/latest/" BACKUP_MANIFEST_FILE ".copy"); | ||||
| @@ -439,7 +439,7 @@ testRun(void) | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 1, TEST_PATH "/bogus"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 2, TEST_PATH_REPO); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 2, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepo, "2"); | ||||
|         hrnCfgArgKeyRawStrId(argList, cfgOptRepoCipherType, 2, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, "--" CFGOPT_CIPHER_PASS "=custom"); | ||||
| @@ -452,7 +452,7 @@ testRun(void) | ||||
|         TEST_TITLE("put encrypted backup_label"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, "--" CFGOPT_CIPHER_PASS "=custom2"); | ||||
|         strLstAdd(argList, STRDEF(STORAGE_PATH_BACKUP "/test/latest/pg_data/backup_label")); | ||||
| @@ -464,7 +464,7 @@ testRun(void) | ||||
|         TEST_TITLE("error when missing source"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoGet, argList); | ||||
|  | ||||
|         TEST_ERROR(storageGetProcess(ioBufferWriteNew(bufNew(0))), ParamRequiredError, "source file required"); | ||||
| @@ -495,7 +495,7 @@ testRun(void) | ||||
|         TEST_TITLE("get an encrypted file with custom key"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, "--" CFGOPT_CIPHER_PASS "=custom"); | ||||
|         strLstAdd(argList, fileEncCustomName); | ||||
| @@ -509,7 +509,7 @@ testRun(void) | ||||
|         TEST_TITLE("get a raw file"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, "--raw"); | ||||
|         strLstAdd(argList, fileRawName); | ||||
| @@ -536,7 +536,7 @@ testRun(void) | ||||
|         TEST_TITLE("ignore missing file"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         strLstAddZ(argList, "--" CFGOPT_IGNORE_MISSING); | ||||
|         strLstAddZ(argList, BOGUS_STR); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoGet, argList); | ||||
| @@ -549,7 +549,7 @@ testRun(void) | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 1, TEST_PATH "/bogus"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 2, TEST_PATH_REPO); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 2, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepo, "2"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, "/somewhere/" INFO_ARCHIVE_FILE); | ||||
| @@ -564,7 +564,7 @@ testRun(void) | ||||
|         TEST_TITLE("get file in repo root directory error"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAdd(argList, fileEncCustomName); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoGet, argList); | ||||
| @@ -578,7 +578,7 @@ testRun(void) | ||||
|         TEST_TITLE("get encrypted archive.info - stanza mismatch"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         strLstAddZ(argList, "--" CFGOPT_STANZA "=test2"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, STORAGE_PATH_ARCHIVE "/test/" INFO_ARCHIVE_FILE); | ||||
| @@ -592,7 +592,7 @@ testRun(void) | ||||
|         TEST_TITLE("get encrypted archive.info"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, STORAGE_PATH_ARCHIVE "/test/" INFO_ARCHIVE_FILE); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoGet, argList); | ||||
| @@ -605,7 +605,7 @@ testRun(void) | ||||
|         TEST_TITLE("get encrypted archive.info.copy"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         strLstAddZ(argList, "--" CFGOPT_STANZA "=test"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, STORAGE_PATH_ARCHIVE "/test/" INFO_ARCHIVE_FILE ".copy"); | ||||
| @@ -619,7 +619,7 @@ testRun(void) | ||||
|         TEST_TITLE("get encrypted backup.info"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, STORAGE_PATH_BACKUP "/test/" INFO_BACKUP_FILE); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoGet, argList); | ||||
| @@ -632,7 +632,7 @@ testRun(void) | ||||
|         TEST_TITLE("get encrypted backup.info.copy"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, STORAGE_PATH_BACKUP "/test/" INFO_BACKUP_FILE ".copy"); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoGet, argList); | ||||
| @@ -648,7 +648,7 @@ testRun(void) | ||||
|         TEST_TITLE("get encrypted WAL archive file"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAdd( | ||||
|             argList, | ||||
| @@ -665,7 +665,7 @@ testRun(void) | ||||
|         TEST_TITLE("get encrypted backup.manifest"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, STORAGE_PATH_BACKUP "/test/latest/" BACKUP_MANIFEST_FILE); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoGet, argList); | ||||
| @@ -678,7 +678,7 @@ testRun(void) | ||||
|         TEST_TITLE("get encrypted backup.manifest.copy"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, STORAGE_PATH_BACKUP "/test/latest/" BACKUP_MANIFEST_FILE ".copy"); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoGet, argList); | ||||
| @@ -691,7 +691,7 @@ testRun(void) | ||||
|         TEST_TITLE("get encrypted backup.history manifest"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAddZ(argList, STORAGE_PATH_BACKUP "/test/backup.history/2020/label.manifest.gz"); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoGet, argList); | ||||
| @@ -704,7 +704,7 @@ testRun(void) | ||||
|         TEST_TITLE("get encrypted backup_label"); | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawStrId(argList, cfgOptRepoCipherType, cipherTypeAes256Cbc); | ||||
|         strLstAdd(argList, STRDEF(STORAGE_PATH_BACKUP "/test/latest/pg_data/backup_label")); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoGet, argList); | ||||
| @@ -769,7 +769,7 @@ testRun(void) | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 1, TEST_PATH "/bogus"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 2, TEST_PATH_REPO); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 2, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepo, "2"); | ||||
|         strLstAddZ(argList, "path/aaa.txt"); | ||||
|         HRN_CFG_LOAD(cfgCmdRepoRm, argList); | ||||
|   | ||||
| @@ -2592,7 +2592,7 @@ testRun(void) | ||||
|         hrnCfgArgKeyRaw(argList, cfgOptRepoPath, 2, repoPath); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepo, "2"); | ||||
|         strLstAdd(argList, strNewFmt("--pg1-path=%s", strZ(pgPath))); | ||||
|         hrnCfgArgRawZ(argList, cfgOptSpoolPath, TEST_PATH_SPOOL); | ||||
|         hrnCfgArgRawZ(argList, cfgOptSpoolPath, TEST_PATH "/spool"); | ||||
|         strLstAddZ(argList, "--delta"); | ||||
|         strLstAddZ(argList, "--type=preserve"); | ||||
|         strLstAddZ(argList, "--link-map=pg_wal=../wal"); | ||||
|   | ||||
| @@ -28,8 +28,8 @@ testRun(void) | ||||
|     StringList *argListBase = strLstNew(); | ||||
|     hrnCfgArgRawBool(argListBase, cfgOptOnline, false); | ||||
|     hrnCfgArgRawZ(argListBase, cfgOptStanza, TEST_STANZA); | ||||
|     hrnCfgArgRawZ(argListBase, cfgOptPgPath, TEST_PATH_PG); | ||||
|     hrnCfgArgRawZ(argListBase, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|     hrnCfgArgRawZ(argListBase, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|     hrnCfgArgRawZ(argListBase, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|  | ||||
|     // ***************************************************************************************************************************** | ||||
|     if (testBegin("cmdStanzaCreate(), checkStanzaInfo(), cmdStanzaDelete()")) | ||||
| @@ -225,12 +225,12 @@ testRun(void) | ||||
|         TEST_TITLE("cmdStanzaDelete - multi-repo and encryption, delete"); | ||||
|  | ||||
|         StringList *argListCmd = strLstNew(); | ||||
|         hrnCfgArgKeyRawZ(argListCmd, cfgOptRepoPath, 1, TEST_PATH_REPO); | ||||
|         hrnCfgArgKeyRawZ(argListCmd, cfgOptRepoPath, 1, TEST_PATH "/repo"); | ||||
|         hrnCfgArgKeyRawZ(argListCmd, cfgOptRepoPath, 2, TEST_PATH "/repo2"); | ||||
|         hrnCfgArgKeyRawZ(argListCmd, cfgOptRepoPath, 3, TEST_PATH "/repo3"); | ||||
|         hrnCfgArgKeyRawZ(argListCmd, cfgOptRepoPath, 4, TEST_PATH "/repo4"); | ||||
|         hrnCfgArgRawZ(argListCmd, cfgOptStanza, TEST_STANZA); | ||||
|         hrnCfgArgRawZ(argListCmd, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argListCmd, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|  | ||||
|         TEST_ERROR( | ||||
|             hrnCfgLoadP(cfgCmdStanzaDelete, argListCmd), OptionRequiredError, | ||||
| @@ -520,8 +520,8 @@ testRun(void) | ||||
|         // Load Parameters | ||||
|         StringList *argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, TEST_STANZA); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         HRN_CFG_LOAD(cfgCmdStanzaCreate, argList); | ||||
|  | ||||
|         //-------------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -534,14 +534,14 @@ testRun(void) | ||||
|  | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH_PG, false, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH "/pg", false, NULL, NULL), | ||||
|             HRNPQ_MACRO_DONE() | ||||
|         }); | ||||
|  | ||||
|         TEST_RESULT_VOID(cmdStanzaCreate(), "stanza create - db online"); | ||||
|         TEST_RESULT_LOG("P00   INFO: stanza-create for stanza 'db' on repo1"); | ||||
|         TEST_STORAGE_LIST( | ||||
|             storageTest, TEST_PATH_REPO, | ||||
|             storageTest, TEST_PATH "/repo", | ||||
|             "archive/\n" | ||||
|             "archive/db/\n" | ||||
|             "archive/db/archive.info\n" | ||||
| @@ -555,7 +555,7 @@ testRun(void) | ||||
|         HRN_CFG_LOAD(cfgCmdStanzaUpgrade, argList); | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH_PG, false, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH "/pg", false, NULL, NULL), | ||||
|             HRNPQ_MACRO_DONE() | ||||
|         }); | ||||
|  | ||||
| @@ -574,14 +574,14 @@ testRun(void) | ||||
|  | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH_PG, false, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH "/pg", false, NULL, NULL), | ||||
|             HRNPQ_MACRO_DONE() | ||||
|         }); | ||||
|  | ||||
|         TEST_ERROR( | ||||
|             pgValidate(), DbMismatchError, | ||||
|             "version '" PG_VERSION_92_STR "' and path '" TEST_PATH_PG "' queried from cluster do not match version '" | ||||
|             PG_VERSION_91_STR "' and '" TEST_PATH_PG "' read from '" TEST_PATH_PG "/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL "'\n" | ||||
|             "version '" PG_VERSION_92_STR "' and path '" TEST_PATH "/pg' queried from cluster do not match version '" | ||||
|             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."); | ||||
|  | ||||
|         //-------------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -601,7 +601,7 @@ testRun(void) | ||||
|         TEST_ERROR( | ||||
|             pgValidate(), DbMismatchError, | ||||
|             "version '" PG_VERSION_92_STR "' and path '" TEST_PATH "/pg2' 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 | ||||
|                 PG_VERSION_92_STR "' and '" TEST_PATH "/pg' read from '" TEST_PATH "/pg/" PG_PATH_GLOBAL "/" PG_FILE_PGCONTROL | ||||
|             "'\nHINT: the pg1-path and pg1-port settings likely reference different clusters."); | ||||
|  | ||||
|         //-------------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -609,9 +609,9 @@ testRun(void) | ||||
|  | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, TEST_STANZA); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH_PG); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 2, TEST_PATH_PG "1"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptPgPath, TEST_PATH "/pg"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 2, TEST_PATH "/pg1"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPort, 2, "5434"); | ||||
|  | ||||
|         HRN_CFG_LOAD(cfgCmdStanzaCreate, argList); | ||||
| @@ -628,7 +628,7 @@ testRun(void) | ||||
|  | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH_PG, true, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH "/pg", true, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(2, "dbname='postgres' port=5434", PG_VERSION_92, TEST_PATH "/pg1", false, NULL, NULL), | ||||
|             HRNPQ_MACRO_DONE() | ||||
|         }); | ||||
| @@ -903,7 +903,7 @@ testRun(void) | ||||
|     { | ||||
|         // Load Parameters | ||||
|         StringList *argListCmd = strLstNew(); | ||||
|         hrnCfgArgKeyRawZ(argListCmd, cfgOptRepoPath, 1, TEST_PATH_REPO); | ||||
|         hrnCfgArgKeyRawZ(argListCmd, cfgOptRepoPath, 1, TEST_PATH "/repo"); | ||||
|  | ||||
|         // Load Parameters | ||||
|         StringList *argList = strLstDup(argListCmd); | ||||
| @@ -922,7 +922,7 @@ testRun(void) | ||||
|  | ||||
|         argList = strLstDup(argListCmd); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, TEST_STANZA); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH_PG); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH "/pg"); | ||||
|         HRN_CFG_LOAD(cfgCmdStanzaDelete, argList); | ||||
|  | ||||
|         //-------------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -986,7 +986,7 @@ testRun(void) | ||||
|         HRN_STORAGE_PUT_EMPTY(storageHrn, strZ(lockStopFileName(cfgOptionStr(cfgOptStanza))), .comment = "create stop file"); | ||||
|         TEST_ERROR( | ||||
|             cmdStanzaDelete(), FileRemoveError, | ||||
|             "unable to remove '" TEST_PATH_REPO "/backup/db/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/db/20190708-154306F", "cleanup - remove backup file"); | ||||
|  | ||||
|         //-------------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -1059,7 +1059,7 @@ testRun(void) | ||||
|  | ||||
|         argList = strLstDup(argListCmd); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, TEST_STANZA); | ||||
|         hrnCfgArgKeyRawFmt(argList, cfgOptPgPath, 1, TEST_PATH_PG); | ||||
|         hrnCfgArgKeyRawFmt(argList, cfgOptPgPath, 1, TEST_PATH "/pg"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 2, TEST_PATH "/repo2"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepo, "1"); | ||||
|         hrnCfgArgRawBool(argList, cfgOptForce, true); | ||||
|   | ||||
| @@ -27,7 +27,7 @@ testRun(void) | ||||
|  | ||||
|     StringList *argListBase = strLstNew(); | ||||
|     hrnCfgArgRawZ(argListBase, cfgOptStanza, "db"); | ||||
|     hrnCfgArgRawZ(argListBase, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|     hrnCfgArgRawZ(argListBase, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|  | ||||
|     const char *fileContents = "acefile"; | ||||
|     uint64_t fileSize = 7; | ||||
| @@ -254,7 +254,7 @@ testRun(void) | ||||
|         TEST_RESULT_PTR(manifest, NULL, "manifest not set - pg version mismatch"); | ||||
|         TEST_RESULT_UINT(backupResult.status, backupInvalid, "manifest unusable - backup invalid"); | ||||
|         TEST_RESULT_LOG( | ||||
|             "P00   WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/20181119-152138F/backup.manifest.copy'" | ||||
|             "P00   WARN: unable to open missing file '" TEST_PATH "/repo/backup/db/20181119-152138F/backup.manifest.copy'" | ||||
|                 " for read\n" | ||||
|             "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"); | ||||
| @@ -289,7 +289,7 @@ testRun(void) | ||||
|         TEST_RESULT_PTR(manifest, NULL, "manifest not set - pg system-id mismatch"); | ||||
|         TEST_RESULT_UINT(backupResult.status, backupInvalid, "manifest unusable - backup invalid"); | ||||
|         TEST_RESULT_LOG( | ||||
|             "P00   WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/20181119-152138F/backup.manifest' for read\n" | ||||
|             "P00   WARN: unable to open missing file '" TEST_PATH "/repo/backup/db/20181119-152138F/backup.manifest' for read\n" | ||||
|             "P00   WARN: 20181119-152138F/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 " | ||||
|                 "not in the backup.info history, skipping"); | ||||
| @@ -323,7 +323,7 @@ testRun(void) | ||||
|         TEST_RESULT_PTR(manifest, NULL, "manifest not set - pg db-id mismatch"); | ||||
|         TEST_RESULT_UINT(backupResult.status, backupInvalid, "manifest unusable - backup invalid"); | ||||
|         TEST_RESULT_LOG( | ||||
|             "P00   WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/20181119-152138F/backup.manifest' for read\n" | ||||
|             "P00   WARN: unable to open missing file '" TEST_PATH "/repo/backup/db/20181119-152138F/backup.manifest' for read\n" | ||||
|             "P00   WARN: 20181119-152138F/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 " | ||||
|                 "6625592122879095702) is not in the backup.info history, skipping"); | ||||
| @@ -334,13 +334,13 @@ testRun(void) | ||||
|         backupResult.status = backupValid; | ||||
|  | ||||
|         HRN_STORAGE_PUT_Z( | ||||
|             storageRepoWrite(), TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/db/" TEST_BACKUP_LABEL_FULL "/" BACKUP_MANIFEST_FILE | ||||
|             storageRepoWrite(), TEST_PATH "/repo/" STORAGE_PATH_BACKUP "/db/" TEST_BACKUP_LABEL_FULL "/" BACKUP_MANIFEST_FILE | ||||
|             INFO_COPY_EXT, TEST_INVALID_BACKREST_INFO, .comment = "invalid manifest copy"); | ||||
|  | ||||
|         TEST_ASSIGN(manifest, verifyManifestFile(&backupResult, NULL, false, infoPg, &jobErrorTotal), "verify manifest"); | ||||
|         TEST_RESULT_UINT(backupResult.status, backupInvalid, "manifest unusable - backup invalid"); | ||||
|         TEST_RESULT_LOG( | ||||
|             "P00   WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/20181119-152138F/backup.manifest' for read\n" | ||||
|             "P00   WARN: unable to open missing file '" TEST_PATH "/repo/backup/db/20181119-152138F/backup.manifest' for read\n" | ||||
|             "P00   WARN: invalid checksum, actual 'e056f784a995841fd4e2802b809299b8db6803a2' but expected 'BOGUS' " | ||||
|                 "<REPO:BACKUP>/20181119-152138F/backup.manifest.copy"); | ||||
|  | ||||
| @@ -348,7 +348,7 @@ testRun(void) | ||||
|         TEST_TITLE("current backup true"); | ||||
|  | ||||
|         HRN_STORAGE_PUT_Z( | ||||
|             storageRepoWrite(), TEST_PATH_REPO "/" STORAGE_PATH_BACKUP "/db/" TEST_BACKUP_LABEL_FULL "/" BACKUP_MANIFEST_FILE, | ||||
|             storageRepoWrite(), TEST_PATH "/repo/" STORAGE_PATH_BACKUP "/db/" TEST_BACKUP_LABEL_FULL "/" BACKUP_MANIFEST_FILE, | ||||
|             TEST_INVALID_BACKREST_INFO, .comment = "invalid manifest"); | ||||
|  | ||||
|         TEST_ASSIGN(manifest, verifyManifestFile(&backupResult, NULL, true, infoPg, &jobErrorTotal), "verify manifest"); | ||||
| @@ -757,10 +757,10 @@ testRun(void) | ||||
|         TEST_RESULT_LOG( | ||||
|             "P00   WARN: invalid checksum, actual 'e056f784a995841fd4e2802b809299b8db6803a2' but expected 'BOGUS' " | ||||
|                 "<REPO:BACKUP>/backup.info\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/backup/db/backup.info.copy' for read\n" | ||||
|             "P00  ERROR: [029]: No usable backup.info file\n" | ||||
|             "P00   WARN: unable to open missing file '" TEST_PATH_REPO "/archive/db/archive.info' 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/archive/db/archive.info' for read\n" | ||||
|             "P00   WARN: unable to open missing file '" TEST_PATH "/repo/archive/db/archive.info.copy' for read\n" | ||||
|             "P00  ERROR: [029]: No usable archive.info file"); | ||||
|  | ||||
|         //-------------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -784,7 +784,7 @@ testRun(void) | ||||
|         TEST_RESULT_LOG( | ||||
|             "P00   WARN: invalid checksum, actual 'e056f784a995841fd4e2802b809299b8db6803a2' but expected 'BOGUS'" | ||||
|                 " <REPO:BACKUP>/backup.info\n" | ||||
|             "P00   WARN: unable to open missing file '" TEST_PATH_REPO "/archive/db/archive.info' for read\n" | ||||
|             "P00   WARN: unable to open missing file '" TEST_PATH "/repo/archive/db/archive.info' for read\n" | ||||
|             "P00   WARN: invalid checksum, actual 'e056f784a995841fd4e2802b809299b8db6803a2' but expected 'BOGUS'" | ||||
|                 " <REPO:ARCHIVE>/archive.info.copy\n" | ||||
|             "P00  ERROR: [029]: No usable archive.info file"); | ||||
| @@ -828,8 +828,8 @@ testRun(void) | ||||
|         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_LOG( | ||||
|             "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 "/archive/db/archive.info.copy' 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/archive/db/archive.info.copy' for read\n" | ||||
|             "P00   WARN: no archives or backups exist in the repo"); | ||||
|  | ||||
|         //-------------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -841,8 +841,8 @@ testRun(void) | ||||
|             .comment = "valid and matching archive.info.copy"); | ||||
|         TEST_ERROR(cmdVerify(), RuntimeError, "1 fatal errors encountered, see log for details"); | ||||
|         TEST_RESULT_LOG( | ||||
|             "P00   WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/backup.info' 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/backup/db/backup.info' for read\n" | ||||
|             "P00   WARN: unable to open missing file '" TEST_PATH "/repo/backup/db/backup.info.copy' for read\n" | ||||
|             "P00  ERROR: [029]: No usable backup.info file"); | ||||
|     } | ||||
|  | ||||
| @@ -1039,7 +1039,7 @@ testRun(void) | ||||
|  | ||||
|         // Load Parameters - single non-default repo | ||||
|         argList = strLstNew(); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 2, TEST_PATH_REPO); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptRepoPath, 2, TEST_PATH "/repo"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptStanza, "db"); | ||||
|         hrnCfgArgRawZ(argList, cfgOptRepo, "2"); | ||||
|         HRN_CFG_LOAD(cfgCmdVerify, argList); | ||||
| @@ -1171,22 +1171,22 @@ testRun(void) | ||||
|                     "'11-2/0000000200000007/000000020000000700000FFF-ee161f898c9012dd0c28b3fd1e7140b9cf411306'\n" | ||||
|                 "P01  ERROR: [039]: invalid result " | ||||
|                     "11-2/0000000200000008/000000020000000800000003-656817043007aa2100c44c712bcb456db705dab9: [41] raised from " | ||||
|                     "local-1 shim protocol: unable to open file '" TEST_PATH_REPO "/archive/db/" | ||||
|                     "local-1 shim protocol: unable to open file '" TEST_PATH "/repo/archive/db/" | ||||
|                     "11-2/0000000200000008/000000020000000800000003-656817043007aa2100c44c712bcb456db705dab9' for read:" | ||||
|                     " [13] Permission denied\n" | ||||
|                 "P00   WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/20181119-152800F/backup.manifest' 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/backup/db/20181119-152800F/backup.manifest' for read\n" | ||||
|                 "P00   WARN: unable to open missing file '" TEST_PATH "/repo/backup/db/20181119-152800F/backup.manifest.copy'" | ||||
|                     " for read\n" | ||||
|                 "P00   WARN: manifest missing for '20181119-152800F' - backup may have expired\n" | ||||
|                 "P00   WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/20181119-152810F/backup.manifest.copy'" | ||||
|                 "P00   WARN: unable to open missing file '" TEST_PATH "/repo/backup/db/20181119-152810F/backup.manifest.copy'" | ||||
|                     " for read\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]: file missing '20181119-152900F_20181119-152909D/pg_data/testmissing'\n" | ||||
|                 "P00   WARN: unable to open missing file '" TEST_PATH_REPO "/backup/db/20181119-153000F/backup.manifest' for read\n" | ||||
|                 "P00   WARN: unable to open missing file '" TEST_PATH "/repo/backup/db/20181119-153000F/backup.manifest' for read\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:" | ||||
|                     " unable to open file '" TEST_PATH_REPO "/backup/db/UNPROCESSEDBACKUP/pg_data/testother' for read: [13]" | ||||
|                     " unable to open file '" TEST_PATH "/repo/backup/db/UNPROCESSEDBACKUP/pg_data/testother' for read: [13]" | ||||
|                     " Permission denied\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" | ||||
|   | ||||
| @@ -71,7 +71,7 @@ testRun(void) | ||||
|                 // Set options | ||||
|                 StringList *argList = strLstNew(); | ||||
|                 strLstAddZ(argList, "--stanza=test1"); | ||||
|                 hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH_PG); | ||||
|                 hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH "/pg"); | ||||
|                 strLstAddZ(argList, "--pg1-database=testdb"); | ||||
|                 hrnCfgArgRawStrId(argList, cfgOptRemoteType, protocolStorageTypePg); | ||||
|                 strLstAddZ(argList, "--process=0"); | ||||
| @@ -83,13 +83,13 @@ testRun(void) | ||||
|                     HRNPQ_MACRO_OPEN(1, "dbname='testdb' port=5432"), | ||||
|                     HRNPQ_MACRO_SET_SEARCH_PATH(1), | ||||
|                     HRNPQ_MACRO_SET_CLIENT_ENCODING(1), | ||||
|                     HRNPQ_MACRO_VALIDATE_QUERY(1, PG_VERSION_84, TEST_PATH_PG, NULL, NULL), | ||||
|                     HRNPQ_MACRO_VALIDATE_QUERY(1, PG_VERSION_84, TEST_PATH "/pg", NULL, NULL), | ||||
|                     HRNPQ_MACRO_CLOSE(1), | ||||
|  | ||||
|                     HRNPQ_MACRO_OPEN(1, "dbname='testdb' port=5432"), | ||||
|                     HRNPQ_MACRO_SET_SEARCH_PATH(1), | ||||
|                     HRNPQ_MACRO_SET_CLIENT_ENCODING(1), | ||||
|                     HRNPQ_MACRO_VALIDATE_QUERY(1, PG_VERSION_84, TEST_PATH_PG, NULL, NULL), | ||||
|                     HRNPQ_MACRO_VALIDATE_QUERY(1, PG_VERSION_84, TEST_PATH "/pg", NULL, NULL), | ||||
|                     HRNPQ_MACRO_WAL_SWITCH(1, "xlog", "000000030000000200000003"), | ||||
|                     HRNPQ_MACRO_CLOSE(1), | ||||
|  | ||||
| @@ -180,7 +180,7 @@ testRun(void) | ||||
|         StringList *argList = strLstNew(); | ||||
|         strLstAddZ(argList, "--stanza=test1"); | ||||
|         strLstAddZ(argList, "--repo1-retention-full=1"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH_PG "1"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH "/pg1"); | ||||
|         strLstAddZ(argList, "--pg1-database=backupdb"); | ||||
|         HRN_CFG_LOAD(cfgCmdBackup, argList); | ||||
|  | ||||
| @@ -238,7 +238,7 @@ testRun(void) | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             // Connect to primary | ||||
|             HRNPQ_MACRO_OPEN_LE_91(1, "dbname='backupdb' port=5432", PG_VERSION_83, TEST_PATH_PG "1", NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_LE_91(1, "dbname='backupdb' port=5432", PG_VERSION_83, TEST_PATH "/pg1", NULL, NULL), | ||||
|  | ||||
|             // Get advisory lock | ||||
|             HRNPQ_MACRO_ADVISORY_LOCK(1, true), | ||||
| @@ -265,7 +265,7 @@ testRun(void) | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             // Connect to primary | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='backupdb' port=5432", PG_VERSION_95, TEST_PATH_PG "1", false, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='backupdb' port=5432", PG_VERSION_95, TEST_PATH "/pg1", false, NULL, NULL), | ||||
|  | ||||
|             // Get start time | ||||
|             HRNPQ_MACRO_TIME_QUERY(1, 1000), | ||||
| @@ -321,7 +321,7 @@ testRun(void) | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             // Connect to primary | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='backupdb' port=5432", PG_VERSION_95, TEST_PATH_PG "1", false, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='backupdb' port=5432", PG_VERSION_95, TEST_PATH "/pg1", false, NULL, NULL), | ||||
|  | ||||
|             // Start backup when backup is in progress | ||||
|             HRNPQ_MACRO_ADVISORY_LOCK(1, true), | ||||
| @@ -360,7 +360,7 @@ testRun(void) | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             // Connect to primary | ||||
|             HRNPQ_MACRO_OPEN_GE_96(1, "dbname='backupdb' port=5432", PG_VERSION_96, TEST_PATH_PG "1", false, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_96(1, "dbname='backupdb' port=5432", PG_VERSION_96, TEST_PATH "/pg1", false, NULL, NULL), | ||||
|  | ||||
|             // Start backup | ||||
|             HRNPQ_MACRO_ADVISORY_LOCK(1, true), | ||||
| @@ -395,18 +395,18 @@ testRun(void) | ||||
|         argList = strLstNew(); | ||||
|         strLstAddZ(argList, "--stanza=test1"); | ||||
|         strLstAddZ(argList, "--repo1-retention-full=1"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH_PG "1"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 2, TEST_PATH_PG "2"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH "/pg1"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 2, TEST_PATH "/pg2"); | ||||
|         strLstAddZ(argList, "--pg2-port=5433"); | ||||
|         HRN_CFG_LOAD(cfgCmdBackup, argList); | ||||
|  | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             // Connect to primary | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_95, TEST_PATH_PG "1", false, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_95, TEST_PATH "/pg1", false, NULL, NULL), | ||||
|  | ||||
|             // Connect to standby | ||||
|             HRNPQ_MACRO_OPEN_GE_92(2, "dbname='postgres' port=5433", PG_VERSION_95, TEST_PATH_PG "2", true, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(2, "dbname='postgres' port=5433", PG_VERSION_95, TEST_PATH "/pg2", true, NULL, NULL), | ||||
|  | ||||
|             // Start backup | ||||
|             HRNPQ_MACRO_ADVISORY_LOCK(1, true), | ||||
| @@ -438,10 +438,10 @@ testRun(void) | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             // Connect to primary | ||||
|             HRNPQ_MACRO_OPEN_GE_96(1, "dbname='postgres' port=5432", PG_VERSION_10, TEST_PATH_PG "1", false, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_96(1, "dbname='postgres' port=5432", PG_VERSION_10, TEST_PATH "/pg1", false, NULL, NULL), | ||||
|  | ||||
|             // Connect to standby | ||||
|             HRNPQ_MACRO_OPEN_GE_96(2, "dbname='postgres' port=5433", PG_VERSION_10, TEST_PATH_PG "2", true, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_96(2, "dbname='postgres' port=5433", PG_VERSION_10, TEST_PATH "/pg2", true, NULL, NULL), | ||||
|  | ||||
|             // Start backup | ||||
|             HRNPQ_MACRO_ADVISORY_LOCK(1, true), | ||||
| @@ -535,7 +535,7 @@ testRun(void) | ||||
|         StringList *argList = strLstNew(); | ||||
|         strLstAddZ(argList, "--stanza=test1"); | ||||
|         strLstAddZ(argList, "--repo1-retention-full=1"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH_PG "1"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH "/pg1"); | ||||
|         strLstAddZ(argList, "--pg1-user=bob"); | ||||
|         HRN_CFG_LOAD(cfgCmdBackup, argList); | ||||
|  | ||||
| @@ -560,7 +560,7 @@ testRun(void) | ||||
|             HRNPQ_MACRO_OPEN(1, "dbname='postgres' port=5432 user='bob'"), | ||||
|             HRNPQ_MACRO_SET_SEARCH_PATH(1), | ||||
|             HRNPQ_MACRO_SET_CLIENT_ENCODING(1), | ||||
|             HRNPQ_MACRO_VALIDATE_QUERY(1, PG_VERSION_94, TEST_PATH_PG, NULL, NULL), | ||||
|             HRNPQ_MACRO_VALIDATE_QUERY(1, PG_VERSION_94, TEST_PATH "/pg", NULL, NULL), | ||||
|             HRNPQ_MACRO_SET_APPLICATION_NAME(1), | ||||
|             HRNPQ_MACRO_IS_STANDBY_QUERY(1, true), | ||||
|             HRNPQ_MACRO_CLOSE(1), | ||||
| @@ -577,7 +577,7 @@ testRun(void) | ||||
|             HRNPQ_MACRO_OPEN(1, "dbname='postgres' port=5432 user='bob'"), | ||||
|             HRNPQ_MACRO_SET_SEARCH_PATH(1), | ||||
|             HRNPQ_MACRO_SET_CLIENT_ENCODING(1), | ||||
|             HRNPQ_MACRO_VALIDATE_QUERY(1, PG_VERSION_94, TEST_PATH_PG, NULL, NULL), | ||||
|             HRNPQ_MACRO_VALIDATE_QUERY(1, PG_VERSION_94, TEST_PATH "/pg", NULL, NULL), | ||||
|             HRNPQ_MACRO_SET_APPLICATION_NAME(1), | ||||
|             HRNPQ_MACRO_IS_STANDBY_QUERY(1, false), | ||||
|             HRNPQ_MACRO_CLOSE(1), | ||||
| @@ -590,7 +590,7 @@ testRun(void) | ||||
|         // ------------------------------------------------------------------------------------------------------------------------- | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_LE_91(1, "dbname='postgres' port=5432 user='bob'", PG_VERSION_84, TEST_PATH_PG "1", NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_LE_91(1, "dbname='postgres' port=5432 user='bob'", PG_VERSION_84, TEST_PATH "/pg1", NULL, NULL), | ||||
|             HRNPQ_MACRO_CLOSE(1), | ||||
|             HRNPQ_MACRO_DONE() | ||||
|         }); | ||||
| @@ -602,7 +602,7 @@ testRun(void) | ||||
|         TEST_RESULT_INT(result.standbyIdx, 0, "    check standby id"); | ||||
|         TEST_RESULT_BOOL(result.standby == NULL, true, "    check standby"); | ||||
|         TEST_RESULT_INT(dbPgVersion(result.primary), PG_VERSION_84, "    version set"); | ||||
|         TEST_RESULT_STR_Z(dbPgDataPath(result.primary), TEST_PATH_PG "1", "    path set"); | ||||
|         TEST_RESULT_STR_Z(dbPgDataPath(result.primary), TEST_PATH "/pg1", "    path set"); | ||||
|  | ||||
|         TEST_RESULT_VOID(dbFree(result.primary), "free primary"); | ||||
|  | ||||
| @@ -611,15 +611,15 @@ testRun(void) | ||||
|         argList = strLstNew(); | ||||
|         strLstAddZ(argList, "--stanza=test1"); | ||||
|         strLstAddZ(argList, "--repo1-retention-full=1"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH_PG "1"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 8, TEST_PATH_PG "8"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH "/pg1"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 8, TEST_PATH "/pg8"); | ||||
|         strLstAddZ(argList, "--pg8-port=5433"); | ||||
|         HRN_CFG_LOAD(cfgCmdBackup, argList); | ||||
|  | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_LE_91(1, "dbname='postgres' port=5432", PG_VERSION_84, TEST_PATH_PG "1", NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_LE_91(8, "dbname='postgres' port=5433", PG_VERSION_84, TEST_PATH_PG "8", NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_LE_91(1, "dbname='postgres' port=5432", PG_VERSION_84, TEST_PATH "/pg1", NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_LE_91(8, "dbname='postgres' port=5433", PG_VERSION_84, TEST_PATH "/pg8", NULL, NULL), | ||||
|  | ||||
|             HRNPQ_MACRO_CLOSE(1), | ||||
|             HRNPQ_MACRO_CLOSE(8), | ||||
| @@ -633,8 +633,8 @@ testRun(void) | ||||
|         // ------------------------------------------------------------------------------------------------------------------------- | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH_PG "1", true, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(8, "dbname='postgres' port=5433", PG_VERSION_92, TEST_PATH_PG "8", true, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH "/pg1", true, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(8, "dbname='postgres' port=5433", PG_VERSION_92, TEST_PATH "/pg8", true, NULL, NULL), | ||||
|  | ||||
|             HRNPQ_MACRO_CLOSE(8), | ||||
|             HRNPQ_MACRO_CLOSE(1), | ||||
| @@ -648,8 +648,8 @@ testRun(void) | ||||
|         // ------------------------------------------------------------------------------------------------------------------------- | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH_PG "1", true, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(8, "dbname='postgres' port=5433", PG_VERSION_92, TEST_PATH_PG "8", true, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH "/pg1", true, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(8, "dbname='postgres' port=5433", PG_VERSION_92, TEST_PATH "/pg8", true, NULL, NULL), | ||||
|  | ||||
|             HRNPQ_MACRO_CLOSE(8), | ||||
|             HRNPQ_MACRO_CLOSE(1), | ||||
| @@ -671,19 +671,19 @@ testRun(void) | ||||
|         argList = strLstNew(); | ||||
|         strLstAddZ(argList, "--stanza=test1"); | ||||
|         strLstAddZ(argList, "--repo1-retention-full=1"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH_PG "1"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 4, TEST_PATH_PG "4"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH "/pg1"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 4, TEST_PATH "/pg4"); | ||||
|         strLstAddZ(argList, "--pg4-port=5433"); | ||||
|         strLstAddZ(argList, "--pg5-host=localhost"); | ||||
|         strLstAddZ(argList, "--pg5-host-user=" TEST_USER); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 5, TEST_PATH_PG "5"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 8, TEST_PATH_PG "8"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 5, TEST_PATH "/pg5"); | ||||
|         hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 8, TEST_PATH "/pg8"); | ||||
|         strLstAddZ(argList, "--pg8-port=5434"); | ||||
|         HRN_CFG_LOAD(cfgCmdBackup, argList); | ||||
|  | ||||
|         harnessPqScriptSet((HarnessPq []) | ||||
|         { | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH_PG "1", true, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(1, "dbname='postgres' port=5432", PG_VERSION_92, TEST_PATH "/pg1", true, NULL, NULL), | ||||
|  | ||||
|             // pg-4 error | ||||
|             {.session = 4, .function = HRNPQ_CONNECTDB, .param = "[\"dbname='postgres' port=5433\"]"}, | ||||
| @@ -691,7 +691,7 @@ testRun(void) | ||||
|             {.session = 4, .function = HRNPQ_ERRORMESSAGE, .resultZ = "error"}, | ||||
|             {.session = 4, .function = HRNPQ_FINISH}, | ||||
|  | ||||
|             HRNPQ_MACRO_OPEN_GE_92(8, "dbname='postgres' port=5434", PG_VERSION_92, TEST_PATH_PG "8", false, NULL, NULL), | ||||
|             HRNPQ_MACRO_OPEN_GE_92(8, "dbname='postgres' port=5434", PG_VERSION_92, TEST_PATH "/pg8", false, NULL, NULL), | ||||
|  | ||||
|             HRNPQ_MACRO_CREATE_RESTORE_POINT(8, "2/3"), | ||||
|             HRNPQ_MACRO_WAL_SWITCH(8, "xlog", "000000010000000200000003"), | ||||
|   | ||||
| @@ -39,11 +39,11 @@ testRun(void) | ||||
|     hrnCfgArgRawZ(argList, cfgOptStanza, "db"); | ||||
|     hrnCfgArgRawZ(argList, cfgOptProtocolTimeout, "10"); | ||||
|     strLstAddZ(argList, "--buffer-size=16384"); | ||||
|     hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH_PG "1"); | ||||
|     hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 1, TEST_PATH "/pg1"); | ||||
|     hrnCfgArgKeyRawZ(argList, cfgOptPgHost, 2, "localhost"); | ||||
|     hrnCfgArgKeyRawZ(argList, cfgOptPgHostUser, 2, TEST_USER); | ||||
|     hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 2, TEST_PATH_PG "2"); | ||||
|     hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH_REPO); | ||||
|     hrnCfgArgKeyRawZ(argList, cfgOptPgPath, 2, TEST_PATH "/pg2"); | ||||
|     hrnCfgArgRawZ(argList, cfgOptRepoPath, TEST_PATH "/repo"); | ||||
|     HRN_CFG_LOAD(cfgCmdBackup, argList); | ||||
|  | ||||
|     const Storage *const storagePgWrite = storagePgGet(1, true); | ||||
| @@ -245,7 +245,7 @@ testRun(void) | ||||
|         // ------------------------------------------------------------------------------------------------------------------------- | ||||
|         TEST_TITLE("read file without compression"); | ||||
|  | ||||
|         HRN_STORAGE_PUT(storageTest, TEST_PATH_REPO "/test.txt", contentBuf); | ||||
|         HRN_STORAGE_PUT(storageTest, TEST_PATH "/repo/test.txt", contentBuf); | ||||
|  | ||||
|         // Disable protocol compression in the storage object | ||||
|         ((StorageRemote *)storageDriver(storageRepo))->compressLevel = 0; | ||||
| @@ -287,9 +287,9 @@ testRun(void) | ||||
|         // ------------------------------------------------------------------------------------------------------------------------- | ||||
|         TEST_TITLE("read with filters"); | ||||
|  | ||||
|         HRN_STORAGE_PUT_Z(storageTest, TEST_PATH_REPO "/test.txt", "TESTDATA!"); | ||||
|         HRN_STORAGE_PUT_Z(storageTest, TEST_PATH "/repo/test.txt", "TESTDATA!"); | ||||
|  | ||||
|         TEST_ASSIGN(fileRead, storageNewReadP(storageRepo, STRDEF(TEST_PATH_REPO "/test.txt"), .limit = VARUINT64(8)), "new read"); | ||||
|         TEST_ASSIGN(fileRead, storageNewReadP(storageRepo, STRDEF(TEST_PATH "/repo/test.txt"), .limit = VARUINT64(8)), "new read"); | ||||
|  | ||||
|         IoFilterGroup *filterGroup = ioReadFilterGroup(storageReadIo(fileRead)); | ||||
|         ioFilterGroupAdd(filterGroup, ioSizeNew()); | ||||
| @@ -313,9 +313,9 @@ testRun(void) | ||||
|         // ------------------------------------------------------------------------------------------------------------------------- | ||||
|         TEST_TITLE("read into sink (no data returned)"); | ||||
|  | ||||
|         HRN_STORAGE_PUT_Z(storageTest, TEST_PATH_REPO "/test.txt", "TESTDATA"); | ||||
|         HRN_STORAGE_PUT_Z(storageTest, TEST_PATH "/repo/test.txt", "TESTDATA"); | ||||
|  | ||||
|         TEST_ASSIGN(fileRead, storageNewReadP(storageRepo, STRDEF(TEST_PATH_REPO "/test.txt"), .limit = VARUINT64(8)), "new read"); | ||||
|         TEST_ASSIGN(fileRead, storageNewReadP(storageRepo, STRDEF(TEST_PATH "/repo/test.txt"), .limit = VARUINT64(8)), "new read"); | ||||
|  | ||||
|         filterGroup = ioReadFilterGroup(storageReadIo(fileRead)); | ||||
|         ioFilterGroupAdd(filterGroup, ioSizeNew()); | ||||
| @@ -419,14 +419,14 @@ testRun(void) | ||||
|  | ||||
|         TEST_ERROR( | ||||
|             storagePathCreateP(storageRepoWrite, STRDEF("testpath"), .errorOnExists = true), PathCreateError, | ||||
|             "raised from remote-0 shim protocol: unable to create path '" TEST_PATH_REPO "/testpath': [17] File exists"); | ||||
|             "raised from remote-0 shim protocol: unable to create path '" TEST_PATH "/repo/testpath': [17] File exists"); | ||||
|  | ||||
|         // ------------------------------------------------------------------------------------------------------------------------- | ||||
|         TEST_TITLE("error on missing parent path"); | ||||
|  | ||||
|         TEST_ERROR( | ||||
|             storagePathCreateP(storageRepoWrite, STRDEF("parent/testpath"), .noParentCreate = true), PathCreateError, | ||||
|             "raised from remote-0 shim protocol: unable to create path '" TEST_PATH_REPO "/parent/testpath': [2] No such" | ||||
|             "raised from remote-0 shim protocol: unable to create path '" TEST_PATH "/repo/parent/testpath': [2] No such" | ||||
|                 " file or directory"); | ||||
|  | ||||
|         // ------------------------------------------------------------------------------------------------------------------------- | ||||
| @@ -438,7 +438,7 @@ testRun(void) | ||||
|  | ||||
|         TEST_RESULT_BOOL( | ||||
|             storageInfoListP( | ||||
|                 storageRepo, STRDEF(TEST_PATH_REPO "/parent"), hrnStorageInfoListCallback, &callbackData, | ||||
|                 storageRepo, STRDEF(TEST_PATH "/repo/parent"), hrnStorageInfoListCallback, &callbackData, | ||||
|                 .sortOrder = sortOrderAsc), | ||||
|             true, "info list"); | ||||
|         TEST_RESULT_STR_Z( | ||||
|   | ||||
		Reference in New Issue
	
	Block a user