mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-06-08 16:26:23 -04:00
Fix conditional tests for check_http, check_curl
Set correct number of tests in skip- blocks to avoid the error "Bad plan. You planned 50 tests but ran 55" when run with/without /usr/bin/faketime and NP_INTERNET_ACCESS=yes/no.
This commit is contained in:
parent
40e171b7cd
commit
5ab03a7095
2 changed files with 4 additions and 4 deletions
|
|
@ -84,7 +84,7 @@ like( $res->output, '/^Host: testhost:8001\s*$/ms', "Host Header OK" );
|
|||
like( $res->output, '/CURLOPT_URL: http:\/\/'.$host_tcp_http.':80\//ms', "Url OK" );
|
||||
|
||||
SKIP: {
|
||||
skip "No internet access", 3 if $internet_access eq "no";
|
||||
skip "No internet access", 4 if $internet_access eq "no";
|
||||
|
||||
$res = NPTest->testCmd("./$plugin -v -H $host_tls_http -S");
|
||||
like( $res->output, '/^Host: '.$host_tls_http.'\s*$/ms', "Host Header OK" );
|
||||
|
|
@ -120,7 +120,7 @@ SKIP: {
|
|||
cmp_ok( $res->return_code, "==", 0, "And also when not found");
|
||||
}
|
||||
SKIP: {
|
||||
skip "No internet access", 16 if $internet_access eq "no";
|
||||
skip "No internet access", 28 if $internet_access eq "no";
|
||||
|
||||
$res = NPTest->testCmd(
|
||||
"./$plugin --ssl $host_tls_http"
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ SKIP: {
|
|||
cmp_ok( $res->return_code, "==", 0, "And also when not found");
|
||||
}
|
||||
SKIP: {
|
||||
skip "No internet access", 16 if $internet_access eq "no";
|
||||
skip "No internet access", 23 if $internet_access eq "no";
|
||||
|
||||
$res = NPTest->testCmd(
|
||||
"./$plugin --ssl $host_tls_http"
|
||||
|
|
@ -135,7 +135,7 @@ SKIP: {
|
|||
|
||||
# run some certificate checks with faketime
|
||||
SKIP: {
|
||||
skip "No faketime binary found", 12 if !$faketime;
|
||||
skip "No faketime binary found", 7 if !$faketime;
|
||||
$res = NPTest->testCmd("LC_TIME=C TZ=UTC ./$plugin -C 1 $host_tls_http");
|
||||
like($res->output, qr/OK - Certificate '$host_tls_cert' will expire on/, "Catch cert output");
|
||||
is( $res->return_code, 0, "Catch cert output exit code" );
|
||||
|
|
|
|||
Loading…
Reference in a new issue