diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index ab4be5b9fa5a..dc07c5e2da65 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -801,7 +801,7 @@ in { nginx-auth = runTest ./nginx-auth.nix; nginx-etag = runTest ./nginx-etag.nix; nginx-etag-compression = runTest ./nginx-etag-compression.nix; - nginx-globalredirect = handleTest ./nginx-globalredirect.nix {}; + nginx-globalredirect = runTest ./nginx-globalredirect.nix; nginx-http3 = handleTest ./nginx-http3.nix {}; nginx-mime = handleTest ./nginx-mime.nix {}; nginx-modsecurity = handleTest ./nginx-modsecurity.nix {}; diff --git a/nixos/tests/nginx-globalredirect.nix b/nixos/tests/nginx-globalredirect.nix index 42dda6ccaab5..ba1c0623593b 100644 --- a/nixos/tests/nginx-globalredirect.nix +++ b/nixos/tests/nginx-globalredirect.nix @@ -1,29 +1,27 @@ -import ./make-test-python.nix ( - { pkgs, ... }: - { - name = "nginx-globalredirect"; +{ ... }: +{ + name = "nginx-globalredirect"; - nodes = { - webserver = - { pkgs, lib, ... }: - { - services.nginx = { - enable = true; - virtualHosts.localhost = { - globalRedirect = "other.example.com"; - # Add an exception - locations."/noredirect".return = "200 'foo'"; - }; + nodes = { + webserver = + { pkgs, lib, ... }: + { + services.nginx = { + enable = true; + virtualHosts.localhost = { + globalRedirect = "other.example.com"; + # Add an exception + locations."/noredirect".return = "200 'foo'"; }; }; - }; + }; + }; - testScript = '' - webserver.wait_for_unit("nginx") - webserver.wait_for_open_port(80) + testScript = '' + webserver.wait_for_unit("nginx") + webserver.wait_for_open_port(80) - webserver.succeed("curl --fail -si http://localhost/alf | grep '^Location:.*/alf'") - webserver.fail("curl --fail -si http://localhost/noredirect | grep '^Location:'") - ''; - } -) + webserver.succeed("curl --fail -si http://localhost/alf | grep '^Location:.*/alf'") + webserver.fail("curl --fail -si http://localhost/noredirect | grep '^Location:'") + ''; +}