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

Add new test for Common::Io::Process.

Show that output on stderr will raise an exception on close() even if the exit code is 0.
This commit is contained in:
David Steele
2018-03-08 12:36:55 -05:00
parent 62a9bdbd4c
commit e331564c90
3 changed files with 18 additions and 1 deletions

View File

@ -42,6 +42,19 @@ sub run
$self->testResult(sub {defined($oIoProcess->processId())}, true, ' process id defined');
}
################################################################################################################################
if ($self->begin('close() and error when stderr has data'))
{
#---------------------------------------------------------------------------------------------------------------------------
my $oIoProcess =
new pgBackRest::Common::Io::Process(
new pgBackRest::Common::Io::Buffered(
new pgBackRest::Common::Io::Handle('test'), 1, 32), "echo '${strFileContent}' 1>&2");
$self->testException(
sub {$oIoProcess->close()}, ERROR_FILE_READ, 'test terminated unexpectedly [000]: TESTDATA');
}
################################################################################################################################
if ($self->begin('close() & error()'))
{