[monitoring-plugins] Adapt tests

Lorenz Kästle git at monitoring-plugins.org
Thu Mar 13 15:20:13 CET 2025


 Module: monitoring-plugins
 Branch: master
 Commit: 89df16e7503539c2b0da7e95375b470559bb94ec
 Author: Lorenz Kästle <12514511+RincewindsHat at users.noreply.github.com>
   Date: Thu Mar 13 00:44:35 2025 +0100
    URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=89df16e7

Adapt tests

---

 plugins/t/check_tcp.t | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/plugins/t/check_tcp.t b/plugins/t/check_tcp.t
index cb4de53d..b47caab3 100644
--- a/plugins/t/check_tcp.t
+++ b/plugins/t/check_tcp.t
@@ -21,19 +21,19 @@ my $host_nonresponsive = getTestParameter("NP_HOST_NONRESPONSIVE", "The hostname
 my $hostname_invalid   = getTestParameter("NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", "nosuchhost");
 my $internet_access    = getTestParameter("NP_INTERNET_ACCESS", "Is this system directly connected to the internet?", "yes");
 
-my $successOutput = '/^TCP OK\s-\s+[0-9]?\.?[0-9]+ second response time on port [0-9]+/';
+my $successOutput = '/Connection time\s+[0-9]?\.?[0-9]+s is within thresholds+/';
 
-my $failedExpect = '/^TCP WARNING\s-\sUnexpected response from host/socket on port [0-9]+/';
+my $failedExpect = '/\sUnexpected response from host/socket on port [0-9]+/';
 
 my $t;
 
 $tests = $tests - 4 if $internet_access eq "no";
 plan tests => $tests;
 
-$t += checkCmd( "./check_tcp $host_tcp_http      -p 80 -wt 300 -ct 600",       0, $successOutput );
-$t += checkCmd( "./check_tcp $host_tcp_http      -p 81 -wt   0 -ct   0 -to 1", 2 ); # use invalid port for this test
-$t += checkCmd( "./check_tcp $host_nonresponsive -p 80 -wt   0 -ct   0 -to 1", 2 );
-$t += checkCmd( "./check_tcp $hostname_invalid   -p 80 -wt   0 -ct   0 -to 1", 2 );
+$t += checkCmd( "./check_tcp $host_tcp_http      -p 80 -w 300 -c 600",       0, $successOutput );
+$t += checkCmd( "./check_tcp $host_tcp_http      -p 81 -w   0 -c   0 -t 1", 2 ); # use invalid port for this test
+$t += checkCmd( "./check_tcp $host_nonresponsive -p 80 -w   0 -c   0 -t 1", 2 );
+$t += checkCmd( "./check_tcp $hostname_invalid   -p 80 -w   0 -c   0 -t 1", 2 );
 if($internet_access ne "no") {
     $t += checkCmd( "./check_tcp -S -D 1 -H $host_tls_http -p 443",              0 );
     $t += checkCmd( "./check_tcp -S -D 9000,1    -H $host_tls_http -p 443",      1 );



More information about the Commits mailing list