mirror of
https://github.com/pi-hole/pi-hole.git
synced 2026-08-27 04:05:42 +00:00
Fix BATS gravity test on curl version >=8.21
Signed-off-by: Christian König <github@yubiuser.dev>
This commit is contained in:
parent
aac48b75ed
commit
20ed2ab95f
1 changed files with 7 additions and 2 deletions
|
|
@ -14,10 +14,13 @@ INFO="[i]"
|
|||
|
||||
# Depending on the curl version, a specific error messages can be returned in case of failure
|
||||
curlVersion=$(curl --version | awk '{print $2;exit}')
|
||||
if echo "${curlVersion%.*}" | awk '{exit !($1 - 7.75 >= 0)}'; then
|
||||
if echo "${curlVersion%.*}" | awk '{exit !($1 - 8.21 >= 0)}'; then
|
||||
curl821=true
|
||||
elif echo "${curlVersion%.*}" | awk '{exit !($1 - 7.75 >= 0)}'; then
|
||||
curl775=true
|
||||
fi
|
||||
|
||||
|
||||
# Really old curl versions miss a fix for using --etag-save and --etag-compare together (https://github.com/curl/curl/pull/5180)
|
||||
# Fixed in curl 7.70.0 - April 29 2020
|
||||
if echo "${curlVersion%.*}" | awk '{exit !($1 - 7.70 >= 0)}'; then
|
||||
|
|
@ -233,7 +236,9 @@ teardown() {
|
|||
assert_line --partial "${INFO} Migrating content of /etc/pihole/adlists.list into new database"
|
||||
|
||||
assert_line --partial "${INFO} Target: http://localhost:81/list"
|
||||
if [ "${curl775}" = true ]; then
|
||||
if [ "${curl821}" = true ]; then
|
||||
assert_line --partial "${CROSS} Status: Retrieval failed (exit_code=7 Msg: Failed to connect to localhost:81"
|
||||
elif [ "${curl775}" = true ]; then
|
||||
assert_line --partial "${CROSS} Status: Retrieval failed (exit_code=7 Msg: Failed to connect to localhost port 81"
|
||||
else
|
||||
assert_line --partial "${CROSS} Status: Retrieval failed (exit_code=7 Msg: No message available. Non supported curl version.)"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue