summary refs log tree commit diff
path: root/nixos/tests/caddy.nix
diff options
context:
space:
mode:
authoremilylange <git@emilylange.de>2023-08-07 23:47:07 +0200
committeremilylange <git@emilylange.de>2023-08-07 23:47:07 +0200
commitefdcf6b96c51dcda341af79af9e291b53788269a (patch)
tree504bcb51d700e710c28c8f6c4b7f6bb9a0f9efe8 /nixos/tests/caddy.nix
parent014c015367fe216b9abdac9a9cc979488a2eac55 (diff)
downloadnixpkgs-efdcf6b96c51dcda341af79af9e291b53788269a.tar
nixpkgs-efdcf6b96c51dcda341af79af9e291b53788269a.tar.gz
nixpkgs-efdcf6b96c51dcda341af79af9e291b53788269a.tar.bz2
nixpkgs-efdcf6b96c51dcda341af79af9e291b53788269a.tar.lz
nixpkgs-efdcf6b96c51dcda341af79af9e291b53788269a.tar.xz
nixpkgs-efdcf6b96c51dcda341af79af9e291b53788269a.tar.zst
nixpkgs-efdcf6b96c51dcda341af79af9e291b53788269a.zip
nixosTests.caddy: remove etag subtest
Caddy 2.7.x does no longer return etags for files with unix modtimes of
0 and 1.
Files in /nix/store have a modtime of 1.

This is something that has been specifically implemented for nix.

For now, we decided to remove the test.
But I might reimplement a similar etag subtest some time in the future.
Diffstat (limited to 'nixos/tests/caddy.nix')
-rw-r--r--nixos/tests/caddy.nix44
1 files changed, 0 insertions, 44 deletions
diff --git a/nixos/tests/caddy.nix b/nixos/tests/caddy.nix
index ed88f08739e..238091ec606 100644
--- a/nixos/tests/caddy.nix
+++ b/nixos/tests/caddy.nix
@@ -22,22 +22,6 @@ import ./make-test-python.nix ({ pkgs, ... }: {
       '';
       services.caddy.enableReload = true;
 
-      specialisation.etag.configuration = {
-        services.caddy.extraConfig = lib.mkForce ''
-          http://localhost {
-            encode gzip
-
-            file_server
-            root * ${
-              pkgs.runCommand "testdir2" {} ''
-                mkdir "$out"
-                echo changed > "$out/example.html"
-              ''
-            }
-          }
-        '';
-      };
-
       specialisation.config-reload.configuration = {
         services.caddy.extraConfig = ''
           http://localhost:8080 {
@@ -55,7 +39,6 @@ import ./make-test-python.nix ({ pkgs, ... }: {
 
   testScript = { nodes, ... }:
     let
-      etagSystem = "${nodes.webserver.system.build.toplevel}/specialisation/etag";
       justReloadSystem = "${nodes.webserver.system.build.toplevel}/specialisation/config-reload";
       multipleConfigs = "${nodes.webserver.system.build.toplevel}/specialisation/multiple-configs";
     in
@@ -65,33 +48,6 @@ import ./make-test-python.nix ({ pkgs, ... }: {
       webserver.wait_for_open_port(80)
 
 
-      def check_etag(url):
-          etag = webserver.succeed(
-              "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 --fail --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 {}, expected 304".format(http_code)
-          return etag
-
-
-      with subtest("check ETag if serving Nix store paths"):
-          old_etag = check_etag(url)
-          webserver.succeed(
-              "${etagSystem}/bin/switch-to-configuration test >&2"
-          )
-          webserver.sleep(1)
-          new_etag = check_etag(url)
-          assert old_etag != new_etag, "Old ETag {} is the same as {}".format(
-              old_etag, new_etag
-          )
-
       with subtest("config is reloaded on nixos-rebuild switch"):
           webserver.succeed(
               "${justReloadSystem}/bin/switch-to-configuration test >&2"