From 1b46f34df27667c013412ba929aaee8d98b22b44 Mon Sep 17 00:00:00 2001 From: Ahmet Oeztuerk Date: Tue, 12 May 2026 15:05:48 +0200 Subject: [PATCH] check_curl tests: accept either string "Connection timed out" or "Operation timed out" An error buffer is defined and then later passed to libcurl using curl_easy_setopt(..,CURLOPT_ERRORBUFFER) The CI pipeline which uses Alma Linux 9, Fedora Latest and Rock Linux 8 , seems to use a libcurl that writes "Connection timed out" to errbuf. But the Debian 13 and possibly other distros and their default libcurl packages write "Operation timed out" instead. Accept both variants. --- plugins/t/check_curl.t | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/t/check_curl.t b/plugins/t/check_curl.t index b3e92dcc..7ec8ca06 100644 --- a/plugins/t/check_curl.t +++ b/plugins/t/check_curl.t @@ -69,31 +69,31 @@ $res = NPTest->testCmd( ); cmp_ok( $res->return_code, '==', 2, "Webserver $host_nonresponsive not responding" ); # was CRITICAL only, but both check_curl and check_http print HTTP CRITICAL (puzzle?!) -like( $res->output, "/cURL returned 28 - Connection timed out after/", "Output OK"); +like( $res->output, "/cURL returned 28 - (Connection|Operation) timed out after/", "Output OK"); # timeout return results can be changed using --timeout-result option $res = NPTest->testCmd( "./$plugin $host_nonresponsive -wt 1 -ct 2 -t 3 --timeout-result ok" ); -like( $res->output, "/cURL returned 28 - Connection timed out after/", "Output OK"); +like( $res->output, "/cURL returned 28 - (Connection|Operation) timed out after/", "Output OK"); cmp_ok( $res->return_code, "==", 0, "Return code is correct due argument: --timeout-result ok"); $res = NPTest->testCmd( "./$plugin $host_nonresponsive -wt 1 -ct 2 -t 3 --timeout-result warning" ); -like( $res->output, "/cURL returned 28 - Connection timed out after/", "Output OK"); +like( $res->output, "/cURL returned 28 - (Connection|Operation) timed out after/", "Output OK"); cmp_ok( $res->return_code, "==", 1, "Return code is correct due argument: --timeout-result warning"); $res = NPTest->testCmd( "./$plugin $host_nonresponsive -wt 1 -ct 2 -t 3 --timeout-result 2" ); -like( $res->output, "/cURL returned 28 - Connection timed out after/", "Output OK"); +like( $res->output, "/cURL returned 28 - (Connection|Operation) timed out after/", "Output OK"); cmp_ok( $res->return_code, "==", 2, "Return code is correct due argument: --timeout-result 2"); $res = NPTest->testCmd( "./$plugin $host_nonresponsive -wt 1 -ct 2 -t 3 --timeout-result 3" ); -like( $res->output, "/cURL returned 28 - Connection timed out after/", "Output OK"); +like( $res->output, "/cURL returned 28 - (Connection|Operation) timed out after/", "Output OK"); cmp_ok( $res->return_code, "==", 3, "Return code is correct due argument: --timeout-result 3"); $res = NPTest->testCmd(