diff options
| author | Sven Nierlein <Sven.Nierlein@consol.de> | 2013-09-16 13:30:21 +0200 |
|---|---|---|
| committer | Sven Nierlein <sven@consol.de> | 2013-09-16 13:49:44 +0200 |
| commit | c001fb98ffb162d6cd148047a3737c78aa737eca (patch) | |
| tree | 1ab10a245ed2ae8afd4330f70fbec083927d1f1d /plugins/t | |
| parent | 2b23caf3d107acc71c03373e815e2d3f3103fe18 (diff) | |
| download | monitoring-plugins-c001fb98ffb162d6cd148047a3737c78aa737eca.tar.gz | |
check_http: tests use supplied value if possible
Diffstat (limited to 'plugins/t')
| -rw-r--r-- | 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 9948c539..f77387de 100644 --- a/plugins/t/check_http.t +++ b/plugins/t/check_http.t | |||
| @@ -30,12 +30,9 @@ my $internet_access = getTestParameter( "NP_INTERNET_ACCESS", | |||
| 30 | "Is this system directly connected to the internet?", | 30 | "Is this system directly connected to the internet?", |
| 31 | "yes"); | 31 | "yes"); |
| 32 | 32 | ||
| 33 | my $host_tcp_http2; | 33 | my $host_tcp_http2 = getTestParameter( "NP_HOST_TCP_HTTP2", |
| 34 | if ($internet_access eq "no") { | ||
| 35 | $host_tcp_http2 = getTestParameter( "NP_HOST_TCP_HTTP2", | ||
| 36 | "A host providing an index page containing the string 'nagios'", | 34 | "A host providing an index page containing the string 'nagios'", |
| 37 | "www.nagios.com" ); | 35 | "nagiosplugins.org" ); |
| 38 | } | ||
| 39 | 36 | ||
| 40 | 37 | ||
| 41 | $res = NPTest->testCmd( | 38 | $res = NPTest->testCmd( |
| @@ -65,10 +62,7 @@ cmp_ok( $res->return_code, '==', 2, "Webserver $hostname_invalid not valid" ); | |||
| 65 | like( $res->output, "/Unable to open TCP socket|Socket timeout after/", "Output OK"); | 62 | like( $res->output, "/Unable to open TCP socket|Socket timeout after/", "Output OK"); |
| 66 | 63 | ||
| 67 | SKIP: { | 64 | SKIP: { |
| 68 | skip "No internet access and no host serving nagios in index file", | 65 | skip "No host serving nagios in index file", 7 unless $host_tcp_http2; |
| 69 | 7 if $internet_access eq "no" && ! $host_tcp_http2; | ||
| 70 | |||
| 71 | $host_tcp_http2 = "www.nagios.com" if (! $host_tcp_http2); | ||
| 72 | 66 | ||
| 73 | $res = NPTest->testCmd( "./check_http -H $host_tcp_http2 -r 'nagios'" ); | 67 | $res = NPTest->testCmd( "./check_http -H $host_tcp_http2 -r 'nagios'" ); |
| 74 | cmp_ok( $res->return_code, "==", 0, "Got a reference to 'nagios'"); | 68 | cmp_ok( $res->return_code, "==", 0, "Got a reference to 'nagios'"); |
