nixos/tests/caddy: Use curl --fail

gstqt5
Scott Worley 2020-09-16 09:03:04 -07:00 committed by Frederik Rietdijk
parent ecbd2a8bc1
commit 8adaa71b52
1 changed files with 4 additions and 2 deletions

View File

@ -57,11 +57,13 @@ import ./make-test-python.nix ({ pkgs, ... }: {
def check_etag(url):
etag = webserver.succeed(
"curl -v '{}' 2>&1 | sed -n -e \"s/^< [Ee][Tt][Aa][Gg]: *//p\"".format(url)
"curl --fail -v '{}' 2>&1 | sed -n -e \"s/^< [Ee][Tt][Aa][Gg]: *//p\"".format(
url
)
)
etag = etag.replace("\r\n", " ")
http_code = webserver.succeed(
"curl --silent --show-error -o /dev/null -w \"%{{http_code}}\" --head -H 'If-None-Match: {}' {}".format(
"curl --fail --silent --show-error -o /dev/null -w \"%{{http_code}}\" --head -H 'If-None-Match: {}' {}".format(
etag, url
)
)