1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-04-19 11:52:32 +02:00

Remove test point infrastructure.

82df7e6f and 9856fef5 updated tests that used test points in preparation for the feature not being available in the C code.

Since tests points are no longer used remove the infrastructure.

Also remove one stray --test option in mock/all that was essentially a noop but no longer works now that the option has been removed.
This commit is contained in:
David Steele 2019-12-10 13:16:47 -05:00
parent d7d663c2b9
commit d0ba8ff58c
20 changed files with 23 additions and 455 deletions

View File

@ -169,15 +169,6 @@ use constant CFGOPT_RECURSE => 'recurse'
use constant CFGOPT_SORT => 'sort'; use constant CFGOPT_SORT => 'sort';
push @EXPORT, qw(CFGOPT_SORT); push @EXPORT, qw(CFGOPT_SORT);
# Command-line only test options
#-----------------------------------------------------------------------------------------------------------------------------------
use constant CFGOPT_TEST => 'test';
push @EXPORT, qw(CFGOPT_TEST);
use constant CFGOPT_TEST_DELAY => 'test-delay';
push @EXPORT, qw(CFGOPT_TEST_DELAY);
use constant CFGOPT_TEST_POINT => 'test-point';
push @EXPORT, qw(CFGOPT_TEST_POINT);
# General options # General options
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
use constant CFGOPT_ARCHIVE_TIMEOUT => 'archive-timeout'; use constant CFGOPT_ARCHIVE_TIMEOUT => 'archive-timeout';
@ -1137,43 +1128,6 @@ my %hConfigDefine =
} }
}, },
# Command-line only test options
#-------------------------------------------------------------------------------------------------------------------------------
&CFGOPT_TEST =>
{
&CFGDEF_TYPE => CFGDEF_TYPE_BOOLEAN,
&CFGDEF_INTERNAL => true,
&CFGDEF_DEFAULT => false,
&CFGDEF_COMMAND =>
{
&CFGCMD_ARCHIVE_PUSH => {},
&CFGCMD_BACKUP => {},
}
},
&CFGOPT_TEST_DELAY =>
{
&CFGDEF_TYPE => CFGDEF_TYPE_FLOAT,
&CFGDEF_INTERNAL => true,
&CFGDEF_DEFAULT => 5,
&CFGDEF_ALLOW_RANGE => [.1, 60],
&CFGDEF_DEPEND =>
{
&CFGDEF_DEPEND_OPTION => CFGOPT_TEST,
&CFGDEF_DEPEND_LIST => [true],
},
&CFGDEF_COMMAND => CFGOPT_TEST,
},
&CFGOPT_TEST_POINT =>
{
&CFGDEF_TYPE => CFGDEF_TYPE_HASH,
&CFGDEF_INTERNAL => true,
&CFGDEF_REQUIRED => false,
&CFGDEF_DEPEND => CFGOPT_TEST_DELAY,
&CFGDEF_COMMAND => CFGOPT_TEST,
},
# General options # General options
#------------------------------------------------------------------------------------------------------------------------------- #-------------------------------------------------------------------------------------------------------------------------------
&CFGOPT_ARCHIVE_TIMEOUT => &CFGOPT_ARCHIVE_TIMEOUT =>

View File

@ -289,9 +289,6 @@ sub processManifest
{name => 'strLsnStart', required => false}, {name => 'strLsnStart', required => false},
); );
# Start backup test point
&log(TEST, TEST_BACKUP_START);
# Get the master protocol for keep-alive # Get the master protocol for keep-alive
my $oProtocolMaster = my $oProtocolMaster =
!isDbLocal({iRemoteIdx => $self->{iMasterRemoteIdx}}) ? !isDbLocal({iRemoteIdx => $self->{iMasterRemoteIdx}}) ?
@ -417,7 +414,7 @@ sub processManifest
# If there are no files to backup then we'll exit with an error unless in test mode. The other way this could happen is if # If there are no files to backup then we'll exit with an error unless in test mode. The other way this could happen is if
# the database is down and backup is called with --no-online twice in a row. # the database is down and backup is called with --no-online twice in a row.
if ($lFileTotal == 0 && !cfgOption(CFGOPT_TEST)) if ($lFileTotal == 0)
{ {
confess &log(ERROR, "no files have changed since the last backup - this seems unlikely", ERROR_FILE_MISSING); confess &log(ERROR, "no files have changed since the last backup - this seems unlikely", ERROR_FILE_MISSING);
} }
@ -735,7 +732,6 @@ sub process
else else
{ {
&log(WARN, "aborted backup ${strAbortedBackup} cannot be resumed: ${strReason}"); &log(WARN, "aborted backup ${strAbortedBackup} cannot be resumed: ${strReason}");
&log(TEST, TEST_BACKUP_NORESUME);
$oStorageRepo->pathRemove(STORAGE_REPO_BACKUP . "/${strAbortedBackup}", {bRecurse => true}); $oStorageRepo->pathRemove(STORAGE_REPO_BACKUP . "/${strAbortedBackup}", {bRecurse => true});
undef($oAbortedManifest); undef($oAbortedManifest);
@ -912,13 +908,10 @@ sub process
$oStorageDbMaster, $strDbMasterPath, $oLastManifest, cfgOption(CFGOPT_ONLINE), cfgOption(CFGOPT_DELTA), $hTablespaceMap, $oStorageDbMaster, $strDbMasterPath, $oLastManifest, cfgOption(CFGOPT_ONLINE), cfgOption(CFGOPT_DELTA), $hTablespaceMap,
$hDatabaseMap, cfgOption(CFGOPT_EXCLUDE, false), $strTimelineCurrent, $strTimelineLast)); $hDatabaseMap, cfgOption(CFGOPT_EXCLUDE, false), $strTimelineCurrent, $strTimelineLast));
&log(TEST, TEST_MANIFEST_BUILD);
# If resuming from an aborted backup # If resuming from an aborted backup
if (defined($oAbortedManifest)) if (defined($oAbortedManifest))
{ {
&log(WARN, "aborted backup ${strBackupLabel} of same type exists, will be cleaned to remove invalid files and resumed"); &log(WARN, "aborted backup ${strBackupLabel} of same type exists, will be cleaned to remove invalid files and resumed");
&log(TEST, TEST_BACKUP_RESUME);
# Clean the backup path before resuming. The delta option may have changed from false to true during the resume clean # Clean the backup path before resuming. The delta option may have changed from false to true during the resume clean
# so set it to the result. # so set it to the result.
@ -996,8 +989,6 @@ sub process
} }
# Remotes no longer needed (destroy them here so they don't timeout) # Remotes no longer needed (destroy them here so they don't timeout)
&log(TEST, TEST_BACKUP_STOP);
undef($oDbMaster); undef($oDbMaster);
protocolDestroy(undef, undef, true); protocolDestroy(undef, undef, true);

View File

@ -90,34 +90,6 @@ my $bLogWarnOnError = 0;
# Store the last logged error # Store the last logged error
my $oErrorLast; my $oErrorLast;
# Test globals
my $bTest = false;
my $fTestDelay;
my $oTestPoint;
####################################################################################################################################
# Test constants
####################################################################################################################################
use constant TEST => 'TEST';
push @EXPORT, qw(TEST);
use constant TEST_ENCLOSE => 'PgBaCkReStTeSt';
push @EXPORT, qw(TEST_ENCLOSE);
use constant TEST_MANIFEST_BUILD => 'MANIFEST-BUILD';
push @EXPORT, qw(TEST_MANIFEST_BUILD);
use constant TEST_BACKUP_RESUME => 'BACKUP-RESUME';
push @EXPORT, qw(TEST_BACKUP_RESUME);
use constant TEST_BACKUP_NORESUME => 'BACKUP-NORESUME';
push @EXPORT, qw(TEST_BACKUP_NORESUME);
use constant TEST_BACKUP_START => 'BACKUP-START';
push @EXPORT, qw(TEST_BACKUP_START);
use constant TEST_BACKUP_STOP => 'BACKUP-STOP';
push @EXPORT, qw(TEST_BACKUP_STOP);
use constant TEST_KEEP_ALIVE => 'KEEP_ALIVE';
push @EXPORT, qw(TEST_KEEP_ALIVE);
use constant TEST_ARCHIVE_PUSH_ASYNC_START => 'ARCHIVE-PUSH-ASYNC-START';
push @EXPORT, qw(TEST_ARCHIVE_PUSH_ASYNC_START);
#################################################################################################################################### ####################################################################################################################################
# logFileSet - set the file messages will be logged to # logFileSet - set the file messages will be logged to
#################################################################################################################################### ####################################################################################################################################
@ -641,19 +613,8 @@ sub log
my $strMessageFormat = $strMessage; my $strMessageFormat = $strMessage;
my $iLogLevelRank = $oLogLevelRank{$strLevel}{rank}; my $iLogLevelRank = $oLogLevelRank{$strLevel}{rank};
# If test message # Level rank must be valid
if ($strLevel eq TEST) if (!defined($iLogLevelRank))
{
if (!defined($oTestPoint) || !defined($$oTestPoint{lc($strMessage)}))
{
return;
}
$iLogLevelRank = $oLogLevelRank{TRACE}{rank} + 1;
$strMessageFormat = TEST_ENCLOSE . '-' . $strMessageFormat . '-' . TEST_ENCLOSE;
}
# Else level rank must be valid
elsif (!defined($iLogLevelRank))
{ {
confess &log(ASSERT, "log level ${strLevel} does not exist"); confess &log(ASSERT, "log level ${strLevel} does not exist");
} }
@ -691,7 +652,7 @@ sub log
} }
# Indent TRACE and debug levels so they are distinct from normal messages # Indent TRACE and debug levels so they are distinct from normal messages
if ($strLevel eq TRACE || $strLevel eq TEST) if ($strLevel eq TRACE)
{ {
$strMessageFormat =~ s/\n/\n /g; $strMessageFormat =~ s/\n/\n /g;
$strMessageFormat = ' ' . $strMessageFormat; $strMessageFormat = ' ' . $strMessageFormat;
@ -729,9 +690,8 @@ sub log
syswrite(*STDERR, "${strMessage}\n"); syswrite(*STDERR, "${strMessage}\n");
$rExtra->{bLogConsole} = true; $rExtra->{bLogConsole} = true;
} }
# Else output to stdout if configured log level setting rank is greater than the display level rank or test flag is set. # Else output to stdout if configured log level setting rank is greater than the display level rank
elsif (!$rExtra->{bLogConsole} && $iLogDisplayLevelRank <= $oLogLevelRank{$strLogLevelConsole}{rank} || elsif (!$rExtra->{bLogConsole} && $iLogDisplayLevelRank <= $oLogLevelRank{$strLogLevelConsole}{rank})
$bTest && $strLevel eq TEST)
{ {
if (!$bSuppressLog) if (!$bSuppressLog)
{ {
@ -746,12 +706,6 @@ sub log
# } # }
} }
# If in test mode and this is a test message then delay so the calling process has time to read the message
if ($bTest && $strLevel eq TEST && $fTestDelay > 0)
{
usleep($fTestDelay * 1000000);
}
$rExtra->{bLogConsole} = true; $rExtra->{bLogConsole} = true;
} }
@ -817,50 +771,6 @@ sub logErrorLast
push @EXPORT, qw(logErrorLast); push @EXPORT, qw(logErrorLast);
####################################################################################################################################
# testSet
#
# Set test parameters.
####################################################################################################################################
sub testSet
{
my $bTestParam = shift;
my $fTestDelayParam = shift;
my $oTestPointParam = shift;
# Set defaults
$bTest = defined($bTestParam) ? $bTestParam : false;
$fTestDelay = defined($bTestParam) ? $fTestDelayParam : $fTestDelay;
$oTestPoint = $oTestPointParam;
# Make sure that a delay is specified in test mode
if ($bTest && !defined($fTestDelay))
{
confess &log(ASSERT, 'iTestDelay must be provided when bTest is true');
}
# Test delay should be between 1 and 600 seconds
if (!($fTestDelay >= 0 && $fTestDelay <= 600))
{
confess &log(ERROR, 'test-delay must be between 1 and 600 seconds');
}
}
push @EXPORT, qw(testSet);
####################################################################################################################################
# testCheck - Check for a test message
####################################################################################################################################
sub testCheck
{
my $strLog = shift;
my $strTest = shift;
return index($strLog, TEST_ENCLOSE . '-' . $strTest . '-' . TEST_ENCLOSE) != -1;
}
push @EXPORT, qw(testCheck);
#################################################################################################################################### ####################################################################################################################################
# logLevel - get the current log levels # logLevel - get the current log levels
#################################################################################################################################### ####################################################################################################################################

View File

@ -299,9 +299,6 @@ sub libcAutoExportTag
'CFGOPT_TARGET_ACTION', 'CFGOPT_TARGET_ACTION',
'CFGOPT_TARGET_EXCLUSIVE', 'CFGOPT_TARGET_EXCLUSIVE',
'CFGOPT_TARGET_TIMELINE', 'CFGOPT_TARGET_TIMELINE',
'CFGOPT_TEST',
'CFGOPT_TEST_DELAY',
'CFGOPT_TEST_POINT',
'CFGOPT_TYPE', 'CFGOPT_TYPE',
'cfgCommandName', 'cfgCommandName',
'cfgOptionIndex', 'cfgOptionIndex',

View File

@ -57,13 +57,6 @@ sub main
if (!$bConfigLoaded) if (!$bConfigLoaded)
{ {
configLoad(undef, $strConfigBin, $strCommand, \$strConfigJson); configLoad(undef, $strConfigBin, $strCommand, \$strConfigJson);
# Set test options
if (cfgOptionTest(CFGOPT_TEST) && cfgOption(CFGOPT_TEST))
{
testSet(cfgOption(CFGOPT_TEST), cfgOption(CFGOPT_TEST_DELAY), cfgOption(CFGOPT_TEST_POINT, false));
}
$bConfigLoaded = true; $bConfigLoaded = true;
} }
else else

View File

@ -268,9 +268,6 @@ sub keepAlive
if (gettimeofday() - $self->{fKeepAliveTimeout} > $self->{fKeepAliveTime}) if (gettimeofday() - $self->{fKeepAliveTimeout} > $self->{fKeepAliveTime})
{ {
$self->noOp(); $self->noOp();
# Keep alive test point
&log(TEST, TEST_KEEP_ALIVE);
} }
} }

View File

@ -466,9 +466,6 @@ STRING_EXTERN(CFGOPT_TARGET_STR, CFGOPT_TARGE
STRING_EXTERN(CFGOPT_TARGET_ACTION_STR, CFGOPT_TARGET_ACTION); STRING_EXTERN(CFGOPT_TARGET_ACTION_STR, CFGOPT_TARGET_ACTION);
STRING_EXTERN(CFGOPT_TARGET_EXCLUSIVE_STR, CFGOPT_TARGET_EXCLUSIVE); STRING_EXTERN(CFGOPT_TARGET_EXCLUSIVE_STR, CFGOPT_TARGET_EXCLUSIVE);
STRING_EXTERN(CFGOPT_TARGET_TIMELINE_STR, CFGOPT_TARGET_TIMELINE); STRING_EXTERN(CFGOPT_TARGET_TIMELINE_STR, CFGOPT_TARGET_TIMELINE);
STRING_EXTERN(CFGOPT_TEST_STR, CFGOPT_TEST);
STRING_EXTERN(CFGOPT_TEST_DELAY_STR, CFGOPT_TEST_DELAY);
STRING_EXTERN(CFGOPT_TEST_POINT_STR, CFGOPT_TEST_POINT);
STRING_EXTERN(CFGOPT_TYPE_STR, CFGOPT_TYPE); STRING_EXTERN(CFGOPT_TYPE_STR, CFGOPT_TYPE);
/*********************************************************************************************************************************** /***********************************************************************************************************************************
@ -1788,30 +1785,6 @@ static ConfigOptionData configOptionData[CFG_OPTION_TOTAL] = CONFIG_OPTION_LIST
CONFIG_OPTION_DEFINE_ID(cfgDefOptTargetTimeline) CONFIG_OPTION_DEFINE_ID(cfgDefOptTargetTimeline)
) )
//------------------------------------------------------------------------------------------------------------------------------
CONFIG_OPTION
(
CONFIG_OPTION_NAME(CFGOPT_TEST)
CONFIG_OPTION_INDEX(0)
CONFIG_OPTION_DEFINE_ID(cfgDefOptTest)
)
//------------------------------------------------------------------------------------------------------------------------------
CONFIG_OPTION
(
CONFIG_OPTION_NAME(CFGOPT_TEST_DELAY)
CONFIG_OPTION_INDEX(0)
CONFIG_OPTION_DEFINE_ID(cfgDefOptTestDelay)
)
//------------------------------------------------------------------------------------------------------------------------------
CONFIG_OPTION
(
CONFIG_OPTION_NAME(CFGOPT_TEST_POINT)
CONFIG_OPTION_INDEX(0)
CONFIG_OPTION_DEFINE_ID(cfgDefOptTestPoint)
)
//------------------------------------------------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------------------------------------------------
CONFIG_OPTION CONFIG_OPTION
( (

View File

@ -381,16 +381,10 @@ Option constants
STRING_DECLARE(CFGOPT_TARGET_EXCLUSIVE_STR); STRING_DECLARE(CFGOPT_TARGET_EXCLUSIVE_STR);
#define CFGOPT_TARGET_TIMELINE "target-timeline" #define CFGOPT_TARGET_TIMELINE "target-timeline"
STRING_DECLARE(CFGOPT_TARGET_TIMELINE_STR); STRING_DECLARE(CFGOPT_TARGET_TIMELINE_STR);
#define CFGOPT_TEST "test"
STRING_DECLARE(CFGOPT_TEST_STR);
#define CFGOPT_TEST_DELAY "test-delay"
STRING_DECLARE(CFGOPT_TEST_DELAY_STR);
#define CFGOPT_TEST_POINT "test-point"
STRING_DECLARE(CFGOPT_TEST_POINT_STR);
#define CFGOPT_TYPE "type" #define CFGOPT_TYPE "type"
STRING_DECLARE(CFGOPT_TYPE_STR); STRING_DECLARE(CFGOPT_TYPE_STR);
#define CFG_OPTION_TOTAL 168 #define CFG_OPTION_TOTAL 165
/*********************************************************************************************************************************** /***********************************************************************************************************************************
Command enum Command enum
@ -588,9 +582,6 @@ typedef enum
cfgOptTargetAction, cfgOptTargetAction,
cfgOptTargetExclusive, cfgOptTargetExclusive,
cfgOptTargetTimeline, cfgOptTargetTimeline,
cfgOptTest,
cfgOptTestDelay,
cfgOptTestPoint,
cfgOptType, cfgOptType,
} ConfigOption; } ConfigOption;

View File

@ -4636,89 +4636,6 @@ static ConfigDefineOptionData configDefineOptionData[] = CFGDEFDATA_OPTION_LIST
) )
) )
// -----------------------------------------------------------------------------------------------------------------------------
CFGDEFDATA_OPTION
(
CFGDEFDATA_OPTION_NAME("test")
CFGDEFDATA_OPTION_REQUIRED(true)
CFGDEFDATA_OPTION_SECTION(cfgDefSectionCommandLine)
CFGDEFDATA_OPTION_TYPE(cfgDefOptTypeBoolean)
CFGDEFDATA_OPTION_INTERNAL(true)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
(
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdArchivePush)
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdBackup)
)
CFGDEFDATA_OPTION_OPTIONAL_LIST
(
CFGDEFDATA_OPTION_OPTIONAL_DEFAULT("0")
)
)
// -----------------------------------------------------------------------------------------------------------------------------
CFGDEFDATA_OPTION
(
CFGDEFDATA_OPTION_NAME("test-delay")
CFGDEFDATA_OPTION_REQUIRED(true)
CFGDEFDATA_OPTION_SECTION(cfgDefSectionCommandLine)
CFGDEFDATA_OPTION_TYPE(cfgDefOptTypeFloat)
CFGDEFDATA_OPTION_INTERNAL(true)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
(
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdArchivePush)
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdBackup)
)
CFGDEFDATA_OPTION_OPTIONAL_LIST
(
CFGDEFDATA_OPTION_OPTIONAL_ALLOW_RANGE(0.1, 60)
CFGDEFDATA_OPTION_OPTIONAL_DEPEND_LIST
(
cfgDefOptTest,
"1"
)
CFGDEFDATA_OPTION_OPTIONAL_DEFAULT("5")
)
)
// -----------------------------------------------------------------------------------------------------------------------------
CFGDEFDATA_OPTION
(
CFGDEFDATA_OPTION_NAME("test-point")
CFGDEFDATA_OPTION_REQUIRED(false)
CFGDEFDATA_OPTION_SECTION(cfgDefSectionCommandLine)
CFGDEFDATA_OPTION_TYPE(cfgDefOptTypeHash)
CFGDEFDATA_OPTION_INTERNAL(true)
CFGDEFDATA_OPTION_INDEX_TOTAL(1)
CFGDEFDATA_OPTION_SECURE(false)
CFGDEFDATA_OPTION_COMMAND_LIST
(
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdArchivePush)
CFGDEFDATA_OPTION_COMMAND(cfgDefCmdBackup)
)
CFGDEFDATA_OPTION_OPTIONAL_LIST
(
CFGDEFDATA_OPTION_OPTIONAL_DEPEND_LIST
(
cfgDefOptTest,
"1"
)
)
)
// ----------------------------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------------------------
CFGDEFDATA_OPTION CFGDEFDATA_OPTION
( (

View File

@ -146,9 +146,6 @@ typedef enum
cfgDefOptTargetAction, cfgDefOptTargetAction,
cfgDefOptTargetExclusive, cfgDefOptTargetExclusive,
cfgDefOptTargetTimeline, cfgDefOptTargetTimeline,
cfgDefOptTest,
cfgDefOptTestDelay,
cfgDefOptTestPoint,
cfgDefOptType, cfgDefOptType,
} ConfigDefineOption; } ConfigDefineOption;

View File

@ -2240,29 +2240,6 @@ static const struct option optionList[] =
.val = PARSE_OPTION_FLAG | cfgOptTargetTimeline, .val = PARSE_OPTION_FLAG | cfgOptTargetTimeline,
}, },
// test option
// -----------------------------------------------------------------------------------------------------------------------------
{
.name = CFGOPT_TEST,
.val = PARSE_OPTION_FLAG | cfgOptTest,
},
// test-delay option
// -----------------------------------------------------------------------------------------------------------------------------
{
.name = CFGOPT_TEST_DELAY,
.has_arg = required_argument,
.val = PARSE_OPTION_FLAG | cfgOptTestDelay,
},
// test-point option
// -----------------------------------------------------------------------------------------------------------------------------
{
.name = CFGOPT_TEST_POINT,
.has_arg = required_argument,
.val = PARSE_OPTION_FLAG | cfgOptTestPoint,
},
// type option // type option
// ----------------------------------------------------------------------------------------------------------------------------- // -----------------------------------------------------------------------------------------------------------------------------
{ {
@ -2425,9 +2402,6 @@ static const ConfigOption optionResolveOrder[] =
cfgOptStopAuto, cfgOptStopAuto,
cfgOptTablespaceMap, cfgOptTablespaceMap,
cfgOptTablespaceMapAll, cfgOptTablespaceMapAll,
cfgOptTest,
cfgOptTestDelay,
cfgOptTestPoint,
cfgOptType, cfgOptType,
cfgOptArchiveCheck, cfgOptArchiveCheck,
cfgOptArchiveCopy, cfgOptArchiveCopy,

View File

@ -1005,8 +1005,6 @@ static const EmbeddedModule embeddedModule[] =
"{name => 'strLsnStart', required => false},\n" "{name => 'strLsnStart', required => false},\n"
");\n" ");\n"
"\n\n" "\n\n"
"&log(TEST, TEST_BACKUP_START);\n"
"\n\n"
"my $oProtocolMaster =\n" "my $oProtocolMaster =\n"
"!isDbLocal({iRemoteIdx => $self->{iMasterRemoteIdx}}) ?\n" "!isDbLocal({iRemoteIdx => $self->{iMasterRemoteIdx}}) ?\n"
"protocolGet(CFGOPTVAL_REMOTE_TYPE_DB, $self->{iMasterRemoteIdx}) : undef;\n" "protocolGet(CFGOPTVAL_REMOTE_TYPE_DB, $self->{iMasterRemoteIdx}) : undef;\n"
@ -1114,7 +1112,7 @@ static const EmbeddedModule embeddedModule[] =
"'HINT: is something wrong with the clock or filesystem timestamps?', ERROR_FILE_MISSING);\n" "'HINT: is something wrong with the clock or filesystem timestamps?', ERROR_FILE_MISSING);\n"
"}\n" "}\n"
"\n\n\n" "\n\n\n"
"if ($lFileTotal == 0 && !cfgOption(CFGOPT_TEST))\n" "if ($lFileTotal == 0)\n"
"{\n" "{\n"
"confess &log(ERROR, \"no files have changed since the last backup - this seems unlikely\", ERROR_FILE_MISSING);\n" "confess &log(ERROR, \"no files have changed since the last backup - this seems unlikely\", ERROR_FILE_MISSING);\n"
"}\n" "}\n"
@ -1387,7 +1385,6 @@ static const EmbeddedModule embeddedModule[] =
"else\n" "else\n"
"{\n" "{\n"
"&log(WARN, \"aborted backup ${strAbortedBackup} cannot be resumed: ${strReason}\");\n" "&log(WARN, \"aborted backup ${strAbortedBackup} cannot be resumed: ${strReason}\");\n"
"&log(TEST, TEST_BACKUP_NORESUME);\n"
"\n" "\n"
"$oStorageRepo->pathRemove(STORAGE_REPO_BACKUP . \"/${strAbortedBackup}\", {bRecurse => true});\n" "$oStorageRepo->pathRemove(STORAGE_REPO_BACKUP . \"/${strAbortedBackup}\", {bRecurse => true});\n"
"undef($oAbortedManifest);\n" "undef($oAbortedManifest);\n"
@ -1539,13 +1536,10 @@ static const EmbeddedModule embeddedModule[] =
"cfgOptionSet(CFGOPT_DELTA, $oBackupManifest->build(\n" "cfgOptionSet(CFGOPT_DELTA, $oBackupManifest->build(\n"
"$oStorageDbMaster, $strDbMasterPath, $oLastManifest, cfgOption(CFGOPT_ONLINE), cfgOption(CFGOPT_DELTA), $hTablespaceMap,\n" "$oStorageDbMaster, $strDbMasterPath, $oLastManifest, cfgOption(CFGOPT_ONLINE), cfgOption(CFGOPT_DELTA), $hTablespaceMap,\n"
"$hDatabaseMap, cfgOption(CFGOPT_EXCLUDE, false), $strTimelineCurrent, $strTimelineLast));\n" "$hDatabaseMap, cfgOption(CFGOPT_EXCLUDE, false), $strTimelineCurrent, $strTimelineLast));\n"
"\n"
"&log(TEST, TEST_MANIFEST_BUILD);\n"
"\n\n" "\n\n"
"if (defined($oAbortedManifest))\n" "if (defined($oAbortedManifest))\n"
"{\n" "{\n"
"&log(WARN, \"aborted backup ${strBackupLabel} of same type exists, will be cleaned to remove invalid files and resumed\");\n" "&log(WARN, \"aborted backup ${strBackupLabel} of same type exists, will be cleaned to remove invalid files and resumed\");\n"
"&log(TEST, TEST_BACKUP_RESUME);\n"
"\n\n\n" "\n\n\n"
"cfgOptionSet(CFGOPT_DELTA, $self->resumeClean($oStorageRepo, $strBackupLabel, $oBackupManifest, $oAbortedManifest,\n" "cfgOptionSet(CFGOPT_DELTA, $self->resumeClean($oStorageRepo, $strBackupLabel, $oBackupManifest, $oAbortedManifest,\n"
"cfgOption(CFGOPT_ONLINE), cfgOption(CFGOPT_DELTA), $strTimelineCurrent, $strTimelineAborted));\n" "cfgOption(CFGOPT_ONLINE), cfgOption(CFGOPT_DELTA), $strTimelineCurrent, $strTimelineAborted));\n"
@ -1609,8 +1603,6 @@ static const EmbeddedModule embeddedModule[] =
"}\n" "}\n"
"}\n" "}\n"
"\n\n" "\n\n"
"&log(TEST, TEST_BACKUP_STOP);\n"
"\n"
"undef($oDbMaster);\n" "undef($oDbMaster);\n"
"protocolDestroy(undef, undef, true);\n" "protocolDestroy(undef, undef, true);\n"
"\n\n\n\n" "\n\n\n\n"
@ -5034,30 +5026,6 @@ static const EmbeddedModule embeddedModule[] =
"my $bLogWarnOnError = 0;\n" "my $bLogWarnOnError = 0;\n"
"\n\n" "\n\n"
"my $oErrorLast;\n" "my $oErrorLast;\n"
"\n\n"
"my $bTest = false;\n"
"my $fTestDelay;\n"
"my $oTestPoint;\n"
"\n\n\n\n"
"use constant TEST => 'TEST';\n"
"push @EXPORT, qw(TEST);\n"
"use constant TEST_ENCLOSE => 'PgBaCkReStTeSt';\n"
"push @EXPORT, qw(TEST_ENCLOSE);\n"
"\n"
"use constant TEST_MANIFEST_BUILD => 'MANIFEST-BUILD';\n"
"push @EXPORT, qw(TEST_MANIFEST_BUILD);\n"
"use constant TEST_BACKUP_RESUME => 'BACKUP-RESUME';\n"
"push @EXPORT, qw(TEST_BACKUP_RESUME);\n"
"use constant TEST_BACKUP_NORESUME => 'BACKUP-NORESUME';\n"
"push @EXPORT, qw(TEST_BACKUP_NORESUME);\n"
"use constant TEST_BACKUP_START => 'BACKUP-START';\n"
"push @EXPORT, qw(TEST_BACKUP_START);\n"
"use constant TEST_BACKUP_STOP => 'BACKUP-STOP';\n"
"push @EXPORT, qw(TEST_BACKUP_STOP);\n"
"use constant TEST_KEEP_ALIVE => 'KEEP_ALIVE';\n"
"push @EXPORT, qw(TEST_KEEP_ALIVE);\n"
"use constant TEST_ARCHIVE_PUSH_ASYNC_START => 'ARCHIVE-PUSH-ASYNC-START';\n"
"push @EXPORT, qw(TEST_ARCHIVE_PUSH_ASYNC_START);\n"
"\n\n\n\n" "\n\n\n\n"
"sub logFileSet\n" "sub logFileSet\n"
"{\n" "{\n"
@ -5509,18 +5477,7 @@ static const EmbeddedModule embeddedModule[] =
"my $strMessageFormat = $strMessage;\n" "my $strMessageFormat = $strMessage;\n"
"my $iLogLevelRank = $oLogLevelRank{$strLevel}{rank};\n" "my $iLogLevelRank = $oLogLevelRank{$strLevel}{rank};\n"
"\n\n" "\n\n"
"if ($strLevel eq TEST)\n" "if (!defined($iLogLevelRank))\n"
"{\n"
"if (!defined($oTestPoint) || !defined($$oTestPoint{lc($strMessage)}))\n"
"{\n"
"return;\n"
"}\n"
"\n"
"$iLogLevelRank = $oLogLevelRank{TRACE}{rank} + 1;\n"
"$strMessageFormat = TEST_ENCLOSE . '-' . $strMessageFormat . '-' . TEST_ENCLOSE;\n"
"}\n"
"\n"
"elsif (!defined($iLogLevelRank))\n"
"{\n" "{\n"
"confess &log(ASSERT, \"log level ${strLevel} does not exist\");\n" "confess &log(ASSERT, \"log level ${strLevel} does not exist\");\n"
"}\n" "}\n"
@ -5554,7 +5511,7 @@ static const EmbeddedModule embeddedModule[] =
"$strMessageFormat =~ s/\\n/\\n /g\n" "$strMessageFormat =~ s/\\n/\\n /g\n"
"}\n" "}\n"
"\n\n" "\n\n"
"if ($strLevel eq TRACE || $strLevel eq TEST)\n" "if ($strLevel eq TRACE)\n"
"{\n" "{\n"
"$strMessageFormat =~ s/\\n/\\n /g;\n" "$strMessageFormat =~ s/\\n/\\n /g;\n"
"$strMessageFormat = ' ' . $strMessageFormat;\n" "$strMessageFormat = ' ' . $strMessageFormat;\n"
@ -5589,19 +5546,13 @@ static const EmbeddedModule embeddedModule[] =
"$rExtra->{bLogConsole} = true;\n" "$rExtra->{bLogConsole} = true;\n"
"}\n" "}\n"
"\n" "\n"
"elsif (!$rExtra->{bLogConsole} && $iLogDisplayLevelRank <= $oLogLevelRank{$strLogLevelConsole}{rank} ||\n" "elsif (!$rExtra->{bLogConsole} && $iLogDisplayLevelRank <= $oLogLevelRank{$strLogLevelConsole}{rank})\n"
"$bTest && $strLevel eq TEST)\n"
"{\n" "{\n"
"if (!$bSuppressLog)\n" "if (!$bSuppressLog)\n"
"{\n" "{\n"
"syswrite(*STDOUT, $strMessageFormat);\n" "syswrite(*STDOUT, $strMessageFormat);\n"
"\n\n\n\n\n\n\n\n" "\n\n\n\n\n\n\n\n"
"}\n" "}\n"
"\n\n"
"if ($bTest && $strLevel eq TEST && $fTestDelay > 0)\n"
"{\n"
"usleep($fTestDelay * 1000000);\n"
"}\n"
"\n" "\n"
"$rExtra->{bLogConsole} = true;\n" "$rExtra->{bLogConsole} = true;\n"
"}\n" "}\n"
@ -5661,39 +5612,6 @@ static const EmbeddedModule embeddedModule[] =
"}\n" "}\n"
"\n" "\n"
"push @EXPORT, qw(logErrorLast);\n" "push @EXPORT, qw(logErrorLast);\n"
"\n\n\n\n\n\n"
"sub testSet\n"
"{\n"
"my $bTestParam = shift;\n"
"my $fTestDelayParam = shift;\n"
"my $oTestPointParam = shift;\n"
"\n\n"
"$bTest = defined($bTestParam) ? $bTestParam : false;\n"
"$fTestDelay = defined($bTestParam) ? $fTestDelayParam : $fTestDelay;\n"
"$oTestPoint = $oTestPointParam;\n"
"\n\n"
"if ($bTest && !defined($fTestDelay))\n"
"{\n"
"confess &log(ASSERT, 'iTestDelay must be provided when bTest is true');\n"
"}\n"
"\n\n"
"if (!($fTestDelay >= 0 && $fTestDelay <= 600))\n"
"{\n"
"confess &log(ERROR, 'test-delay must be between 1 and 600 seconds');\n"
"}\n"
"}\n"
"\n"
"push @EXPORT, qw(testSet);\n"
"\n\n\n\n"
"sub testCheck\n"
"{\n"
"my $strLog = shift;\n"
"my $strTest = shift;\n"
"\n"
"return index($strLog, TEST_ENCLOSE . '-' . $strTest . '-' . TEST_ENCLOSE) != -1;\n"
"}\n"
"\n"
"push @EXPORT, qw(testCheck);\n"
"\n\n\n\n" "\n\n\n\n"
"sub logLevel\n" "sub logLevel\n"
"{\n" "{\n"
@ -7789,9 +7707,6 @@ static const EmbeddedModule embeddedModule[] =
"'CFGOPT_TARGET_ACTION',\n" "'CFGOPT_TARGET_ACTION',\n"
"'CFGOPT_TARGET_EXCLUSIVE',\n" "'CFGOPT_TARGET_EXCLUSIVE',\n"
"'CFGOPT_TARGET_TIMELINE',\n" "'CFGOPT_TARGET_TIMELINE',\n"
"'CFGOPT_TEST',\n"
"'CFGOPT_TEST_DELAY',\n"
"'CFGOPT_TEST_POINT',\n"
"'CFGOPT_TYPE',\n" "'CFGOPT_TYPE',\n"
"'cfgCommandName',\n" "'cfgCommandName',\n"
"'cfgOptionIndex',\n" "'cfgOptionIndex',\n"
@ -7913,12 +7828,6 @@ static const EmbeddedModule embeddedModule[] =
"if (!$bConfigLoaded)\n" "if (!$bConfigLoaded)\n"
"{\n" "{\n"
"configLoad(undef, $strConfigBin, $strCommand, \\$strConfigJson);\n" "configLoad(undef, $strConfigBin, $strCommand, \\$strConfigJson);\n"
"\n\n"
"if (cfgOptionTest(CFGOPT_TEST) && cfgOption(CFGOPT_TEST))\n"
"{\n"
"testSet(cfgOption(CFGOPT_TEST), cfgOption(CFGOPT_TEST_DELAY), cfgOption(CFGOPT_TEST_POINT, false));\n"
"}\n"
"\n"
"$bConfigLoaded = true;\n" "$bConfigLoaded = true;\n"
"}\n" "}\n"
"else\n" "else\n"
@ -9579,8 +9488,6 @@ static const EmbeddedModule embeddedModule[] =
"if (gettimeofday() - $self->{fKeepAliveTimeout} > $self->{fKeepAliveTime})\n" "if (gettimeofday() - $self->{fKeepAliveTimeout} > $self->{fKeepAliveTime})\n"
"{\n" "{\n"
"$self->noOp();\n" "$self->noOp();\n"
"\n\n"
"&log(TEST, TEST_KEEP_ALIVE);\n"
"}\n" "}\n"
"}\n" "}\n"
"\n\n\n\n\n\n" "\n\n\n\n\n\n"

View File

@ -1085,9 +1085,9 @@ P00 ERROR: [070]: tablespace symlink [TEST_PATH]/db-master/db/base/invalid_tbls
P00 INFO: backup command end: aborted with exception [070] P00 INFO: backup command end: aborted with exception [070]
incr backup - add tablespace 1 (db-master host) incr backup - add tablespace 1 (db-master host)
> [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --no-online --test --stanza=db backup > [CONTAINER-EXEC] db-master [BACKREST-BIN] --config=[TEST_PATH]/db-master/pgbackrest.conf --no-online --stanza=db backup
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
P00 INFO: backup command begin [BACKREST-VERSION]: --no-compress --compress-level=3 --config=[TEST_PATH]/db-master/pgbackrest.conf --db-timeout=45 --lock-path=[TEST_PATH]/db-master/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/log --log-subprocess --no-log-timestamp --no-online --pg1-path=[TEST_PATH]/db-master/db/base --protocol-timeout=60 --repo1-path=[TEST_PATH]/db-master/repo --stanza=db --start-fast --test P00 INFO: backup command begin [BACKREST-VERSION]: --no-compress --compress-level=3 --config=[TEST_PATH]/db-master/pgbackrest.conf --db-timeout=45 --lock-path=[TEST_PATH]/db-master/lock --log-level-console=detail --log-level-file=trace --log-level-stderr=off --log-path=[TEST_PATH]/db-master/log --log-subprocess --no-log-timestamp --no-online --pg1-path=[TEST_PATH]/db-master/db/base --protocol-timeout=60 --repo1-path=[TEST_PATH]/db-master/repo --stanza=db --start-fast
P00 WARN: option repo1-retention-full is not set, the repository may run out of space P00 WARN: option repo1-retention-full is not set, the repository may run out of space
HINT: to retain full backups indefinitely (without warning), set option 'repo1-retention-full' to the maximum. HINT: to retain full backups indefinitely (without warning), set option 'repo1-retention-full' to the maximum.
P00 INFO: last backup label = [BACKUP-FULL-2], version = [VERSION-1] P00 INFO: last backup label = [BACKUP-FULL-2], version = [VERSION-1]

View File

@ -540,7 +540,7 @@ P00 WARN: incr backup cannot alter 'checksum-page' option to 'false', reset to
P00 ERROR: [070]: tablespace symlink [TEST_PATH]/db-master/db/base/invalid_tblspc destination must not be in $PGDATA P00 ERROR: [070]: tablespace symlink [TEST_PATH]/db-master/db/base/invalid_tblspc destination must not be in $PGDATA
incr backup - add tablespace 1 (backup host) incr backup - add tablespace 1 (backup host)
> [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --no-online --test --stanza=db backup > [CONTAINER-EXEC] backup [BACKREST-BIN] --config=[TEST_PATH]/backup/pgbackrest.conf --no-online --stanza=db backup
------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------
P00 WARN: option repo1-retention-full is not set, the repository may run out of space P00 WARN: option repo1-retention-full is not set, the repository may run out of space
HINT: to retain full backups indefinitely (without warning), set option 'repo1-retention-full' to the maximum. HINT: to retain full backups indefinitely (without warning), set option 'repo1-retention-full' to the maximum.

View File

@ -131,13 +131,11 @@ sub endRetry
my my
( (
$strOperation, $strOperation,
$strTest,
$bWait $bWait
) = ) =
logDebugParam logDebugParam
( (
__PACKAGE__ . '->endRetry', \@_, __PACKAGE__ . '->endRetry', \@_,
{name => 'strTest', required => false, trace => true},
{name => 'bWait', required => false, default => true, trace => true} {name => 'bWait', required => false, default => true, trace => true}
); );
@ -173,12 +171,6 @@ sub endRetry
{ {
syswrite(*STDOUT, " ${strLine}\n") syswrite(*STDOUT, " ${strLine}\n")
} }
if (defined($strTest) && testCheck($strLine, $strTest))
{
&log(DEBUG, "Found test ${strTest}");
return true;
}
} }
# Drain the stderr stream # Drain the stderr stream
@ -272,11 +264,6 @@ sub endRetry
print "output:\n$self->{strOutLog}\n"; print "output:\n$self->{strOutLog}\n";
} }
if (defined($strTest))
{
confess &log(ASSERT, "test point ${strTest} was not found");
}
# Return from function and log return values if any # Return from function and log return values if any
return logDebugReturn return logDebugReturn
( (
@ -296,13 +283,11 @@ sub end
my my
( (
$strOperation, $strOperation,
$strTest,
$bWait $bWait
) = ) =
logDebugParam logDebugParam
( (
__PACKAGE__ . '->end', \@_, __PACKAGE__ . '->end', \@_,
{name => 'strTest', required => false, trace => true},
{name => 'bWait', required => false, default => true, trace => true} {name => 'bWait', required => false, default => true, trace => true}
); );
@ -311,7 +296,7 @@ sub end
if (!defined($self->{iRetrySeconds})) if (!defined($self->{iRetrySeconds}))
{ {
$iExitStatus = $self->endRetry($strTest, $bWait); $iExitStatus = $self->endRetry($bWait);
} }
# Else loop until success or timeout # Else loop until success or timeout
else else
@ -322,7 +307,7 @@ sub end
{ {
$self->{bRetry} = false; $self->{bRetry} = false;
$self->begin(); $self->begin();
$iExitStatus = $self->endRetry($strTest, $bWait); $iExitStatus = $self->endRetry($bWait);
if ($self->{bRetry}) if ($self->{bRetry})
{ {
@ -334,7 +319,7 @@ sub end
if ($self->{bRetry}) if ($self->{bRetry})
{ {
$self->begin(); $self->begin();
$iExitStatus = $self->endRetry($strTest, $bWait); $iExitStatus = $self->endRetry($bWait);
} }
} }
@ -353,16 +338,9 @@ sub executeTest
{ {
my $strCommand = shift; my $strCommand = shift;
my $oParam = shift; my $oParam = shift;
my $strTest = shift;
my $oExec = new pgBackRestTest::Common::ExecuteTest($strCommand, $oParam); my $oExec = new pgBackRestTest::Common::ExecuteTest($strCommand, $oParam);
$oExec->begin(); $oExec->begin();
if (defined($strTest))
{
$oExec->end($strTest);
}
$oExec->end(); $oExec->end();
return $oExec->{strOutLog}; return $oExec->{strOutLog};

View File

@ -574,7 +574,7 @@ sub end
my $strTestDone = $self->{oProcess}{test}; my $strTestDone = $self->{oProcess}{test};
my $iTestDoneIdx = $self->{oProcess}{idx}; my $iTestDoneIdx = $self->{oProcess}{idx};
my $iExitStatus = $oExecDone->end(undef, $self->{iVmMax} == 1); my $iExitStatus = $oExecDone->end($self->{iVmMax} == 1);
if (defined($iExitStatus)) if (defined($iExitStatus))
{ {

View File

@ -169,8 +169,6 @@ sub backupBegin
); );
# Set defaults # Set defaults
my $strTest = defined($$oParam{strTest}) ? $$oParam{strTest} : undef;
my $fTestDelay = defined($$oParam{fTestDelay}) ? $$oParam{fTestDelay} : .2;
my $oExpectedManifest = defined($$oParam{oExpectedManifest}) ? $$oParam{oExpectedManifest} : undef; my $oExpectedManifest = defined($$oParam{oExpectedManifest}) ? $$oParam{oExpectedManifest} : undef;
$strComment = $strComment =
@ -188,19 +186,12 @@ sub backupBegin
(defined($$oParam{bStandby}) && $$oParam{bStandby} ? " --backup-standby" : '') . (defined($$oParam{bStandby}) && $$oParam{bStandby} ? " --backup-standby" : '') .
(defined($oParam->{strRepoType}) ? " --repo1-type=$oParam->{strRepoType}" : '') . (defined($oParam->{strRepoType}) ? " --repo1-type=$oParam->{strRepoType}" : '') .
($strType ne 'incr' ? " --type=${strType}" : '') . ($strType ne 'incr' ? " --type=${strType}" : '') .
' --stanza=' . (defined($oParam->{strStanza}) ? $oParam->{strStanza} : $self->stanza()) . ' backup' . ' --stanza=' . (defined($oParam->{strStanza}) ? $oParam->{strStanza} : $self->stanza()) . ' backup',
(defined($strTest) ? " --test --test-delay=${fTestDelay} --test-point=" . lc($strTest) . '=y' : ''),
{strComment => $strComment, iExpectedExitStatus => $$oParam{iExpectedExitStatus}, {strComment => $strComment, iExpectedExitStatus => $$oParam{iExpectedExitStatus},
oLogTest => $self->{oLogTest}, bLogOutput => $self->synthetic()}); oLogTest => $self->{oLogTest}, bLogOutput => $self->synthetic()});
$oExecuteBackup->begin(); $oExecuteBackup->begin();
# Return at the test point if one was defined
if (defined($strTest))
{
$oExecuteBackup->end($strTest);
}
# Return from function and log return values if any # Return from function and log return values if any
return logDebugReturn return logDebugReturn
( (

View File

@ -863,8 +863,7 @@ sub run
\%oManifest, MANIFEST_TARGET_PGTBLSPC . '/1', DB_FILE_PREFIX_TMP . '/' . DB_FILE_PREFIX_TMP . '.1', 'IGNORE'); \%oManifest, MANIFEST_TARGET_PGTBLSPC . '/1', DB_FILE_PREFIX_TMP . '/' . DB_FILE_PREFIX_TMP . '.1', 'IGNORE');
} }
my $strBackup = $oHostBackup->backup( my $strBackup = $oHostBackup->backup($strType, 'add tablespace 1', {oExpectedManifest => \%oManifest});
$strType, 'add tablespace 1', {oExpectedManifest => \%oManifest, strOptionalParam => '--test'});
# Resume Incr Backup # Resume Incr Backup
#--------------------------------------------------------------------------------------------------------------------------- #---------------------------------------------------------------------------------------------------------------------------

View File

@ -88,7 +88,6 @@ testRun(void)
TEST_RESULT_BOOL(cfgDefOptionInternal(cfgDefCmdRestore, cfgDefOptSet), false, "option set is not internal"); TEST_RESULT_BOOL(cfgDefOptionInternal(cfgDefCmdRestore, cfgDefOptSet), false, "option set is not internal");
TEST_RESULT_BOOL(cfgDefOptionInternal(cfgDefCmdRestore, cfgDefOptPgHost), true, "option pg-host is internal"); TEST_RESULT_BOOL(cfgDefOptionInternal(cfgDefCmdRestore, cfgDefOptPgHost), true, "option pg-host is internal");
TEST_RESULT_BOOL(cfgDefOptionInternal(cfgDefCmdRestore, cfgDefOptTest), true, "option test is internal");
TEST_RESULT_BOOL(cfgDefOptionMulti(cfgDefOptRecoveryOption), true, "recovery-option is multi"); TEST_RESULT_BOOL(cfgDefOptionMulti(cfgDefOptRecoveryOption), true, "recovery-option is multi");
TEST_RESULT_BOOL(cfgDefOptionMulti(cfgDefOptDbInclude), true, "db-include is multi"); TEST_RESULT_BOOL(cfgDefOptionMulti(cfgDefOptDbInclude), true, "db-include is multi");

View File

@ -882,11 +882,11 @@ testRun(void)
strLstAdd(argList, strNew(TEST_BACKREST_EXE)); strLstAdd(argList, strNew(TEST_BACKREST_EXE));
strLstAdd(argList, strNew("--pg1-path=/path/to/db")); strLstAdd(argList, strNew("--pg1-path=/path/to/db"));
strLstAdd(argList, strNew("--stanza=db")); strLstAdd(argList, strNew("--stanza=db"));
strLstAdd(argList, strNew("--test-delay=1")); strLstAdd(argList, strNew("--spool-path=/path/to/spool"));
strLstAdd(argList, strNew(TEST_COMMAND_BACKUP)); strLstAdd(argList, strNew(TEST_COMMAND_ARCHIVE_GET));
TEST_ERROR( TEST_ERROR(
configParse(strLstSize(argList), strLstPtr(argList), false), OptionInvalidError, configParse(strLstSize(argList), strLstPtr(argList), false), OptionInvalidError,
"option 'test-delay' not valid without option 'test'"); "option 'spool-path' not valid without option 'archive-async'");
// ------------------------------------------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------------------------------------------
argList = strLstNew(); argList = strLstNew();