From e0b127312797cd4619886dc6df57411a77fe2d33 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Sat, 8 Nov 2025 00:46:37 +0100 Subject: check_smtp: adapt tests --- plugins/t/check_smtp.t | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'plugins/t/check_smtp.t') diff --git a/plugins/t/check_smtp.t b/plugins/t/check_smtp.t index 73b4a1fd..6c8601d3 100644 --- a/plugins/t/check_smtp.t +++ b/plugins/t/check_smtp.t @@ -5,6 +5,7 @@ # use strict; +use warnings; use Test::More; use NPTest; @@ -42,12 +43,11 @@ SKIP: { TODO: { local $TODO = "Output is over two lines"; - like ( $res->output, qr/^SMTP WARNING/, "Correct error message" ); } $res = NPTest->testCmd( "./check_smtp -H $host_tcp_smtp --ssl -p 25" ); is ($res->return_code, 2, "Check rc of connecting to $host_tcp_smtp with TLS on standard SMTP port" ); - like ($res->output, qr/^CRITICAL - Cannot make SSL connection\./, "Check output of connecting to $host_tcp_smtp with TLS on standard SMTP port"); + like ($res->output, qr/^cannot create TLS context\./, "Check output of connecting to $host_tcp_smtp with TLS on standard SMTP port"); } SKIP: { @@ -68,7 +68,6 @@ SKIP: { skip "No SMTP server with TLS defined", 1 unless $host_tcp_smtp_tls; $res = NPTest->testCmd( "./check_smtp -H $host_tcp_smtp_tls --ssl" ); is ($res->return_code, 0, "Check rc of connecting to $host_tcp_smtp_tls with TLS" ); - like ($res->output, qr/^SMTP OK - /, "Check output of connecting to $host_tcp_smtp_tls with TLS" ); my $unused_port = 4465; $res = NPTest->testCmd( "./check_smtp -H $host_tcp_smtp_tls -p $unused_port --ssl" ); -- cgit v1.2.3-74-g34f1 From 4442ea917b9b3a7bc4fe4b980bbfc70b533a6010 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Sat, 8 Nov 2025 01:15:54 +0100 Subject: small test correction --- plugins/t/check_smtp.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/t/check_smtp.t') diff --git a/plugins/t/check_smtp.t b/plugins/t/check_smtp.t index 6c8601d3..c2f53c3d 100644 --- a/plugins/t/check_smtp.t +++ b/plugins/t/check_smtp.t @@ -25,7 +25,7 @@ my $hostname_invalid = getTestParameter( "NP_HOSTNAME_INVALID", "An invalid (not known to DNS) hostname", "nosuchhost" ); my $res; -plan tests => 15; +plan tests => 13; SKIP: { skip "No SMTP server defined", 4 unless $host_tcp_smtp; @@ -47,7 +47,7 @@ SKIP: { $res = NPTest->testCmd( "./check_smtp -H $host_tcp_smtp --ssl -p 25" ); is ($res->return_code, 2, "Check rc of connecting to $host_tcp_smtp with TLS on standard SMTP port" ); - like ($res->output, qr/^cannot create TLS context\./, "Check output of connecting to $host_tcp_smtp with TLS on standard SMTP port"); + like ($res->output, qr/cannot create TLS context/, "Check output of connecting to $host_tcp_smtp with TLS on standard SMTP port"); } SKIP: { -- cgit v1.2.3-74-g34f1