[nagiosplug] check_http: tests use supplied value if possible
Nagios Plugin Development
nagios-plugins at users.sourceforge.net
Tue Sep 17 10:20:22 CEST 2013
Module: nagiosplug
Branch: master
Commit: c001fb98ffb162d6cd148047a3737c78aa737eca
Author: Sven Nierlein <Sven.Nierlein at consol.de>
Committer: Sven Nierlein <sven at consol.de>
Date: Mon Sep 16 13:30:21 2013 +0200
URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/nagiosplug;a=commit;h=c001fb9
check_http: tests use supplied value if possible
---
plugins/t/check_http.t | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/plugins/t/check_http.t b/plugins/t/check_http.t
index 9948c53..f77387d 100644
--- a/plugins/t/check_http.t
+++ b/plugins/t/check_http.t
@@ -30,12 +30,9 @@ my $internet_access = getTestParameter( "NP_INTERNET_ACCESS",
"Is this system directly connected to the internet?",
"yes");
-my $host_tcp_http2;
-if ($internet_access eq "no") {
- $host_tcp_http2 = getTestParameter( "NP_HOST_TCP_HTTP2",
+my $host_tcp_http2 = getTestParameter( "NP_HOST_TCP_HTTP2",
"A host providing an index page containing the string 'nagios'",
- "www.nagios.com" );
-}
+ "nagiosplugins.org" );
$res = NPTest->testCmd(
@@ -65,10 +62,7 @@ cmp_ok( $res->return_code, '==', 2, "Webserver $hostname_invalid not valid" );
like( $res->output, "/Unable to open TCP socket|Socket timeout after/", "Output OK");
SKIP: {
- skip "No internet access and no host serving nagios in index file",
- 7 if $internet_access eq "no" && ! $host_tcp_http2;
-
- $host_tcp_http2 = "www.nagios.com" if (! $host_tcp_http2);
+ skip "No host serving nagios in index file", 7 unless $host_tcp_http2;
$res = NPTest->testCmd( "./check_http -H $host_tcp_http2 -r 'nagios'" );
cmp_ok( $res->return_code, "==", 0, "Got a reference to 'nagios'");
More information about the Commits
mailing list