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.
This commit is contained in:
Artem Boldariev
2021-11-23 12:58:06 +02:00
parent 5069b58dc9
commit f6ef74b196

View 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