You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-06-20 23:59:28 +02:00
Up to seven standbys can be configured for backup from standby.`
Contributed by Cynthia Shang.
This commit is contained in:
committed by
David Steele
parent
206415d4c7
commit
36e576b483
43
test/lib/pgBackRestTest/Module/Common/CommonLogTest.pm
Normal file
43
test/lib/pgBackRestTest/Module/Common/CommonLogTest.pm
Normal file
@ -0,0 +1,43 @@
|
||||
####################################################################################################################################
|
||||
# CommonLogTest.pm - Unit tests for Log module
|
||||
####################################################################################################################################
|
||||
package pgBackRestTest::Module::Common::CommonLogTest;
|
||||
use parent 'pgBackRestTest::Common::RunTest';
|
||||
|
||||
####################################################################################################################################
|
||||
# Perl includes
|
||||
####################################################################################################################################
|
||||
use strict;
|
||||
use warnings FATAL => qw(all);
|
||||
use Carp qw(confess);
|
||||
use English '-no_match_vars';
|
||||
|
||||
use pgBackRest::Common::Exception;
|
||||
use pgBackRest::Common::Ini;
|
||||
use pgBackRest::Common::Log;
|
||||
use pgBackRest::Version;
|
||||
|
||||
use pgBackRestTest::Common::ExecuteTest;
|
||||
use pgBackRestTest::Common::RunTest;
|
||||
|
||||
####################################################################################################################################
|
||||
# run
|
||||
####################################################################################################################################
|
||||
sub run
|
||||
{
|
||||
my $self = shift;
|
||||
|
||||
################################################################################################################################
|
||||
if ($self->begin("log()"))
|
||||
{
|
||||
logWarnOnErrorEnable();
|
||||
$self->testResult(sub {&log(ERROR, "my test log", 27)}, "[object]", 'log error as warning',
|
||||
{strLogExpect => "WARN: [027]: my test log"});
|
||||
|
||||
logWarnOnErrorDisable();
|
||||
$self->testResult(sub {&log(ERROR, "my test log", 27)}, "[object]", 'log error',
|
||||
{strLogExpect => "ERROR: [027]: my test log"});
|
||||
}
|
||||
}
|
||||
|
||||
1;
|
Reference in New Issue
Block a user