1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-03 11:02:05 +00:00

nixos/tests/caddy: Use curl --fail

This commit is contained in:
Scott Worley 2020-09-16 09:03:04 -07:00 committed by Frederik Rietdijk
parent ecbd2a8bc1
commit 8adaa71b52

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
)
)