summary refs log tree commit diff
path: root/nixos/tests/caddy.nix
diff options
context:
space:
mode:
authorSylvain Fankhauser <sylvain.fankhauser@liip.ch>2020-09-07 09:42:00 +0200
committerSylvain Fankhauser <sylvain.fankhauser@liip.ch>2020-09-08 09:29:04 +0200
commitb8bfe941fa7912bc68fb952fb268bc529eb502ca (patch)
tree3e151cb8dcd4108df42241ffe27c48dde2b00410 /nixos/tests/caddy.nix
parentc3a7c89a20fbb602a176cd6e82bd6609d2eb9bf7 (diff)
downloadnixpkgs-b8bfe941fa7912bc68fb952fb268bc529eb502ca.tar
nixpkgs-b8bfe941fa7912bc68fb952fb268bc529eb502ca.tar.gz
nixpkgs-b8bfe941fa7912bc68fb952fb268bc529eb502ca.tar.bz2
nixpkgs-b8bfe941fa7912bc68fb952fb268bc529eb502ca.tar.lz
nixpkgs-b8bfe941fa7912bc68fb952fb268bc529eb502ca.tar.xz
nixpkgs-b8bfe941fa7912bc68fb952fb268bc529eb502ca.tar.zst
nixpkgs-b8bfe941fa7912bc68fb952fb268bc529eb502ca.zip
caddy: address remaining MR comments for v2
Diffstat (limited to 'nixos/tests/caddy.nix')
-rw-r--r--nixos/tests/caddy.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/nixos/tests/caddy.nix b/nixos/tests/caddy.nix
index e9a93df4f48..445a7fa6b0b 100644
--- a/nixos/tests/caddy.nix
+++ b/nixos/tests/caddy.nix
@@ -11,6 +11,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
         http://localhost {
           encode gzip
 
+          file_server
           root * ${
             pkgs.runCommand "testdir" {} ''
               mkdir "$out"
@@ -25,6 +26,7 @@ import ./make-test-python.nix ({ pkgs, ... }: {
           http://localhost {
             encode gzip
 
+            file_server
             root * ${
               pkgs.runCommand "testdir2" {} ''
                 mkdir "$out"
@@ -59,9 +61,11 @@ import ./make-test-python.nix ({ pkgs, ... }: {
         )
         etag = etag.replace("\r\n", " ")
         http_code = webserver.succeed(
-            "curl -w \"%{{http_code}}\" -X HEAD -H 'If-None-Match: {}' {}".format(etag, url)
+            "curl --silent --show-error -o /dev/null -w \"%{{http_code}}\" --head -H 'If-None-Match: {}' {}".format(
+                etag, url
+            )
         )
-        assert int(http_code) == 304, "HTTP code is not 304"
+        assert int(http_code) == 304, "HTTP code is {}, expected 304".format(http_code)
         return etag