Skip to content

Commit

Permalink
nixos/tests/nginx-mime: add check optimal size of types_hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Izorkin committed Sep 26, 2024
1 parent d856c03 commit 9343e69
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions nixos/tests/all-tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,7 @@ in {
nginx-etag-compression = handleTest ./nginx-etag-compression.nix {};
nginx-globalredirect = handleTest ./nginx-globalredirect.nix {};
nginx-http3 = handleTest ./nginx-http3.nix {};
nginx-mime = handleTest ./nginx-mime.nix {};
nginx-modsecurity = handleTest ./nginx-modsecurity.nix {};
nginx-moreheaders = handleTest ./nginx-moreheaders.nix {};
nginx-njs = handleTest ./nginx-njs.nix {};
Expand Down
26 changes: 26 additions & 0 deletions nixos/tests/nginx-mime.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import ./make-test-python.nix (
{ lib, pkgs, ... }:
{
name = "nginx-mime";
meta.maintainers = with pkgs.lib.maintainers; [ izorkin ];

nodes = {
server =
{ pkgs, ... }:
{
services.nginx = {
enable = true;
virtualHosts."localhost" = { };
};
};
};

testScript = ''
server.start()
server.wait_for_unit("nginx")
# Check optimal size of types_hash
server.fail("journalctl --unit nginx --grep 'could not build optimal types_hash'")
server.shutdown()
'';
}
)
3 changes: 3 additions & 0 deletions pkgs/data/misc/mailcap/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchurl
, nixosTests

# updater
, git
Expand Down Expand Up @@ -44,6 +45,8 @@ stdenv.mkDerivation rec {
exec nix-update --version "$VERSION" "$@"
'';

passthru.tests.nginx-mime = nixosTests.nginx-mime;

meta = with lib; {
description = "Helper application and MIME type associations for file types";
homepage = "https://pagure.io/mailcap";
Expand Down

0 comments on commit 9343e69

Please sign in to comment.