]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix doth test when curl without HTTP/2 support is unavailable
authorArtem Boldariev <artem@boldariev.com>
Tue, 23 Nov 2021 10:58:06 +0000 (12:58 +0200)
committerArtem Boldariev <artem@boldariev.com>
Thu, 25 Nov 2021 08:51:12 +0000 (10:51 +0200)
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

index 4b7527e13b570a4eef0f1c239549c03e0c808327..77acac562d2cc2e72494959da58aee172426bb81 100644 (file)
@@ -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