From f6ef74b1960118e0842499e1c5d3f06932328464 Mon Sep 17 00:00:00 2001 From: Artem Boldariev Date: Tue, 23 Nov 2021 12:58:06 +0200 Subject: [PATCH] Fix doth test when curl without HTTP/2 support is unavailable This commit makes the 'doth' system test skip HTTP headers check when curl version is new enough but was compiled without HTTP/2 support. This should fix the 'doth' system test for macOS systems using macports. --- bin/tests/system/doth/tests.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bin/tests/system/doth/tests.sh b/bin/tests/system/doth/tests.sh index 4b7527e13b..77acac562d 100644 --- a/bin/tests/system/doth/tests.sh +++ b/bin/tests/system/doth/tests.sh @@ -445,14 +445,12 @@ status=$((status + ret)) # check whether we can use curl for sending test queries. if [ -x "${CURL}" ] ; then - CURL_VERSION="$(curl --version | cut -d ' ' -f 2 | head -n 1)" - CURL_MAJOR="$(echo "$CURL_VERSION" | cut -d '.' -f 1)" - CURL_MINOR="$(echo "$CURL_VERSION" | cut -d '.' -f 2)" + CURL_HTTP2="$(${CURL} --version | grep '^Features:.* HTTP2\( \|$\)')" - if [ "$CURL_MAJOR" -ge 7 ] && [ "$CURL_MINOR" -ge 49 ]; then + if [ -n "$CURL_HTTP2" ]; then testcurl=1 else - echo_i "The available version of CURL is too old (it should be >= 7.49)" + echo_i "The available version of CURL does not have HTTP/2 support" fi fi