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

Closed #113: Better error message when repo does not exist.

This commit is contained in:
David Steele
2016-02-06 16:49:12 -05:00
parent f8b47997a3
commit de9b6d5133
9 changed files with 51 additions and 3 deletions
+13
View File
@@ -88,6 +88,8 @@ sub BackRestTestBackup_Test
#-------------------------------------------------------------------------------------------------------------------------------
# Create remotes
#-------------------------------------------------------------------------------------------------------------------------------
BackRestTestBackup_Create(true, false);
my $oRemote = new BackRest::Protocol::RemoteMaster
(
BackRestTestCommon_CommandRemoteFullGet(), # Remote command
@@ -99,6 +101,8 @@ sub BackRestTestBackup_Test
PROTOCOL_TIMEOUT_TEST # Protocol timeout
);
BackRestTestBackup_Drop();
my $oLocal = new BackRest::Protocol::Common
(
OPTION_DEFAULT_BUFFER_SIZE, # Buffer size
@@ -1044,6 +1048,15 @@ sub BackRestTestBackup_Test
$strFullBackup = BackRestTestBackup_BackupSynthetic($strType, $strStanza, \%oManifest, 'resume',
{strTest => TEST_BACKUP_RESUME});
# Misconfigure repo-path and check errors
#-----------------------------------------------------------------------------------------------------------------------
if ($bNeutralTest)
{
BackRestTestBackup_BackupSynthetic($strType, $strStanza, \%oManifest, 'invalid repo',
{strOptionalParam => '--' . ($bRemote ? OPTION_REPO_REMOTE_PATH : OPTION_REPO_PATH) . '=/bogus_path' .
' --log-level-console=info', iExpectedExitStatus => ERROR_PATH_MISSING});
}
# Restore - tests various mode, extra files/paths, missing files/paths
#-----------------------------------------------------------------------------------------------------------------------
my $bDelta = true;
+3 -2
View File
@@ -102,11 +102,12 @@ sub BackRestTestFile_Test
#-------------------------------------------------------------------------------------------------------------------------------
# Create remotes
#-------------------------------------------------------------------------------------------------------------------------------
executeTest('rm -rf ' . cwd() . '/log_remote');
mkdir($strTestPath, oct('0770')) or confess 'Unable to create test directory';
mkdir($strTestPath . '/backrest', oct('0770')) or confess 'Unable to create test directory';
my $oRemote = new BackRest::Protocol::RemoteMaster
(
BackRestTestCommon_CommandRemoteFullGet() . ' --repo-path=' . cwd() . '/log_remote', # Remote command
BackRestTestCommon_CommandRemoteFullGet(), # Remote command
OPTION_DEFAULT_BUFFER_SIZE, # Buffer size
OPTION_DEFAULT_COMPRESS_LEVEL, # Compress level
OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK, # Compress network level
+7
View File
@@ -530,6 +530,13 @@ db-version="9.3"
[db:history]
1={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":6156904820763115222,"db-version":"9.3"}
full backup (invalid repo)
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-start-stop --repo-path=/bogus_path --log-level-console=info --type=full --stanza=db backup
------------------------------------------------------------------------------------------------------------------------------------
INFO: backup start: --no-compress --config=[TEST_PATH]/db/pg_backrest.conf --config-remote=[TEST_PATH]/backrest/pg_backrest.conf --db-path=[TEST_PATH]/db/common --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --log-level-console=info --log-level-file=trace --no-start-stop --repo-path=/bogus_path --repo-remote-path=/bogus_path --stanza=db --start-fast --type=full
ERROR: [148]: repo-path '/bogus_path' does not exist
INFO: backup stop
restore delta, backup '[BACKUP-FULL-2]' (add and delete files)
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --set=[BACKUP-FULL-2] --stanza=db restore
------------------------------------------------------------------------------------------------------------------------------------
+7
View File
@@ -716,6 +716,13 @@ db-version="9.3"
[db:history]
1={"db-catalog-version":201306121,"db-control-version":937,"db-system-id":6156904820763115222,"db-version":"9.3"}
full backup (invalid repo)
> [BACKREST_BIN] --config=[TEST_PATH]/backrest/pg_backrest.conf --no-start-stop --repo-remote-path=/bogus_path --log-level-console=info --type=full --stanza=db backup
------------------------------------------------------------------------------------------------------------------------------------
INFO: backup start: --cmd-remote=[BACKREST_BIN] --no-compress --config=[TEST_PATH]/backrest/pg_backrest.conf --config-remote=[TEST_PATH]/db/pg_backrest.conf --db-host=127.0.0.1 --db-path=[TEST_PATH]/db/common --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --db-user=vagrant --log-level-console=info --log-level-file=trace --no-start-stop --repo-path=[TEST_PATH]/backrest --repo-remote-path=/bogus_path --stanza=db --start-fast --type=full
ERROR: [148]: remote process terminated: ERROR [148]: repo-remote-path '/bogus_path' does not exist
INFO: backup stop
restore delta, backup '[BACKUP-FULL-2]' (add and delete files)
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --delta --set=[BACKUP-FULL-2] --stanza=db restore
------------------------------------------------------------------------------------------------------------------------------------