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

Implement issue #92: Check for ERRORs in backup full tests

This commit is contained in:
David Steele
2015-05-29 17:58:13 -04:00
parent e7d2d704fe
commit 1586e0eb75
11 changed files with 243 additions and 230 deletions

View File

@@ -243,6 +243,7 @@ sub BackRestTestBackup_ClusterStop
{
my $strPath = shift;
my $bImmediate = shift;
my $bNoError = shift;
# Set default
$strPath = defined($strPath) ? $strPath : BackRestTestCommon_DbCommonPathGet();
@@ -251,8 +252,16 @@ sub BackRestTestBackup_ClusterStop
# Disconnect user session
BackRestTestBackup_PgDisconnect();
# Drop the cluster
# Stop the cluster
BackRestTestCommon_ClusterStop($strPath, $bImmediate);
# Grep for errors in postgresql.log
if ((!defined($bNoError) || !$bNoError) &&
-e BackRestTestCommon_DbCommonPathGet() . '/postgresql.log')
{
BackRestTestCommon_Execute('grep ERROR ' . BackRestTestCommon_DbCommonPathGet() . '/postgresql.log',
undef, undef, undef, 1);
}
}
####################################################################################################################################
@@ -365,9 +374,10 @@ sub BackRestTestBackup_ClusterCreate
sub BackRestTestBackup_Drop
{
my $bImmediate = shift;
my $bNoError = shift;
# Stop the cluster if one is running
BackRestTestBackup_ClusterStop(BackRestTestCommon_DbCommonPathGet(), $bImmediate);
BackRestTestBackup_ClusterStop(BackRestTestCommon_DbCommonPathGet(), $bImmediate, $bNoError);
# Drop the test path
BackRestTestCommon_Drop();
@@ -1494,6 +1504,9 @@ sub BackRestTestBackup_Test
# Print test banner
&log(INFO, 'BACKUP MODULE ******************************************************************');
# Drop any existing cluster
BackRestTestBackup_Drop(true, true);
#-------------------------------------------------------------------------------------------------------------------------------
# Create remotes
#-------------------------------------------------------------------------------------------------------------------------------