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.
This commit is contained in:
Ahmet Oeztuerk 2026-05-12 15:05:48 +02:00
parent a764295d31
commit 1b46f34df2

View file

@ -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(