>hostname, 'test', 'hostname set from URL');
is($plugin->path, '/check_ok', 'path set from URL');
isnt($plugin->ssl, 1, 'SSL set from URL');
# Change the hostname
$plugin->hostname('server1');
# Cha
>hostname, 'server1', 'hostname changed');
is($plugin->path, '/check_ok', 'path still the same');
isnt($plugin->ssl, 1, 'SSL still the same');
# Test setting the default status
is(eval{$plugin->defau
imeout
isnt($plugin->has_timeout, 1, 'Has no timeout');
$plugin->timeout(2);
is($plugin->has_timeout, 1, 'Has timeout');
is($plugin->timeout, 2, 'timeout updates');
$plugin->clear_timeout;
isnt($plugi
'http://example.net/nagios/check_nonexistant', 'URL is what was set');
isnt($plugin->has_message, 1, 'Has no message yet');
isnt($plugin->has_status, 1, 'Has no status yet');
is($plugin->status, 3, '
nged
is $plugin->url , $url , "$name: URL was set";
isnt $plugin->has_message, 1 , "$name: Has no message yet";
isnt $plugin->has_status , 1 , "$name: Has no status yet";
is
]);
###########################################################################
# TIMEOUT TESTS
isnt($plugin->has_timeout, 1, 'Has not timeout yet');
$plugin->timeout(10);
is($plugin->has_timeout, 1
CRITICAL');
$plugin->url('http://example.net/nagios/check_time_6');
is($plugin->status, 0, 'Timeout did not occur');
$plugin->clear_timeout;
isnt($plugin->has_timeout, 1, 'Timeout cleared');
exit 0;
.net --path /nagios/check_service --timeout=20 --no-ssl';
my $plugin = Nagios::Plugin::OverHTTP->new_with_options;
ok(defined $plugin, 'plugin initiated');
isnt($plugin->ssl, 1, 'Unset bool');
}
essage, 'Response message same';
is $new_resp->status, $resp->status, 'Response status same';
isnt $new_resp, $resp, 'Response different object';
};
};
##########################################