Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make the sockerr2 test a bit more forgiving

  • Loading branch information...
commit fbaa60e167d8ebcdc8a47431bdf02ad21bd602c3 1 parent 8a6bd84
@bingos authored
View
4 lib/POE/Component/Client/NRPE.pm
@@ -350,7 +350,7 @@ POE::Component::Client::NRPE - a POE Component that implements check_nrpe functi
=head1 DESCRIPTION
POE::Component::Client::NRPE is a L<POE> component that implements version 1 and version 2 of
-the nrpe (Nagios Remote Plugin Executor) client, check_nrpe. It also supports SSL encryption
+the nrpe (Nagios Remote Plugin Executor) client, check_nrpe. It also supports SSL encryption
using L<Net::SSLeay> and a hacked version of L<POE::Component::SSLify>.
=head1 CONSTRUCTOR
@@ -389,7 +389,7 @@ This is generated by the poco. ARG0 will be a hash reference with the following
'command', the command that was run;
'context', anything that you specified;
'result', the Nagios result code, can be 0,1,2 or 3;
- 'data', what the NRPEd gave us by way of output;
+ 'data', what the NRPEd gave us by way of output;
=head1 AUTHOR
View
6 t/01_ver1.t
@@ -9,8 +9,8 @@ use Test::POE::Server::TCP;
POE::Session->create(
package_states => [
'main' => [qw(
- _start
- _response
+ _start
+ _response
nrped_client_input
)],
],
@@ -27,7 +27,7 @@ sub _start {
);
my $port = $heap->{nrped}->port();
- my $check = POE::Component::Client::NRPE->check_nrpe(
+ my $check = POE::Component::Client::NRPE->check_nrpe(
host => '127.0.0.1',
port => $port,
event => '_response',
View
6 t/02_ver2.t
@@ -9,8 +9,8 @@ use Test::POE::Server::TCP;
POE::Session->create(
package_states => [
'main' => [qw(
- _start
- _response
+ _start
+ _response
nrped_client_input
)],
],
@@ -27,7 +27,7 @@ sub _start {
);
my $port = $heap->{nrped}->port();
- my $check = POE::Component::Client::NRPE->check_nrpe(
+ my $check = POE::Component::Client::NRPE->check_nrpe(
host => '127.0.0.1',
port => $port,
event => '_response',
View
6 t/03_sockerr.t
@@ -9,9 +9,9 @@ use Test::POE::Server::TCP;
POE::Session->create(
package_states => [
'main' => [qw(
- _start
+ _start
nrped_connected
- _response
+ _response
)],
],
);
@@ -30,7 +30,7 @@ sub _start {
$heap->{nrped}->shutdown();
delete $heap->{nrped};
- my $check = POE::Component::Client::NRPE->check_nrpe(
+ my $check = POE::Component::Client::NRPE->check_nrpe(
host => '127.0.0.1',
port => $port,
event => '_response',
View
8 t/03_sockerr2.t
@@ -7,8 +7,8 @@ use POE;
POE::Session->create(
package_states => [
'main' => [qw(
- _start
- _response
+ _start
+ _response
)],
],
);
@@ -19,7 +19,7 @@ exit 0;
sub _start {
my ($kernel,$heap) = @_[KERNEL,HEAP];
- my $check = POE::Component::Client::NRPE->check_nrpe(
+ my $check = POE::Component::Client::NRPE->check_nrpe(
host => 'zxkchzxkchzkxhckjhkzjhckzcxkhzk',
event => '_response',
usessl => 0,
@@ -35,7 +35,7 @@ sub _response {
my ($kernel,$heap,$res) = @_[KERNEL,HEAP,ARG0];
is( $res->{context}->{thing}, 'moo', 'Context data was okay' );
is( $res->{version}, '2', 'Response version' );
- is( $res->{result}, '3', 'The result code was okay' );
+ like( $res->{result}, qr/^[23]$/, 'The result code was okay' );
diag( $res->{data}, "\n" );
return;
}
View
6 t/04_timeouts.t
@@ -9,8 +9,8 @@ use Test::POE::Server::TCP;
POE::Session->create(
package_states => [
'main' => [qw(
- _start
- _response
+ _start
+ _response
nrped_client_input
)],
],
@@ -27,7 +27,7 @@ sub _start {
);
my $port = $heap->{nrped}->port();
- my $check = POE::Component::Client::NRPE->check_nrpe(
+ my $check = POE::Component::Client::NRPE->check_nrpe(
host => '127.0.0.1',
port => $port,
event => '_response',
View
6 t/04_unknown.t
@@ -9,8 +9,8 @@ use Test::POE::Server::TCP;
POE::Session->create(
package_states => [
'main' => [qw(
- _start
- _response
+ _start
+ _response
nrped_client_input
)],
],
@@ -27,7 +27,7 @@ sub _start {
);
my $port = $heap->{nrped}->port();
- my $check = POE::Component::Client::NRPE->check_nrpe(
+ my $check = POE::Component::Client::NRPE->check_nrpe(
host => '127.0.0.1',
port => $port,
event => '_response',
View
6 t/05_nodata.t
@@ -9,8 +9,8 @@ use Test::POE::Server::TCP;
POE::Session->create(
package_states => [
'main' => [qw(
- _start
- _response
+ _start
+ _response
nrped_client_input
)],
],
@@ -27,7 +27,7 @@ sub _start {
);
my $port = $heap->{nrped}->port();
- my $check = POE::Component::Client::NRPE->check_nrpe(
+ my $check = POE::Component::Client::NRPE->check_nrpe(
host => '127.0.0.1',
port => $port,
event => '_response',
View
6 t/06_badpacket.t
@@ -9,8 +9,8 @@ use Test::POE::Server::TCP;
POE::Session->create(
package_states => [
'main' => [qw(
- _start
- _response
+ _start
+ _response
nrped_client_input
)],
],
@@ -27,7 +27,7 @@ sub _start {
);
my $port = $heap->{nrped}->port();
- my $check = POE::Component::Client::NRPE->check_nrpe(
+ my $check = POE::Component::Client::NRPE->check_nrpe(
host => '127.0.0.1',
port => $port,
event => '_response',
View
6 t/07_insanity.t
@@ -9,8 +9,8 @@ use Test::POE::Server::TCP;
POE::Session->create(
package_states => [
'main' => [qw(
- _start
- _response
+ _start
+ _response
nrped_client_input
)],
],
@@ -27,7 +27,7 @@ sub _start {
);
my $port = $heap->{nrped}->port();
- my $check = POE::Component::Client::NRPE->check_nrpe(
+ my $check = POE::Component::Client::NRPE->check_nrpe(
host => '127.0.0.1',
port => $port,
event => '_response',

0 comments on commit fbaa60e

Please sign in to comment.
Something went wrong with that request. Please try again.