nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix

nixosTests.nginx-globalredirect: migrate to runTest

Part of #386873

+23 -25
+1 -1
nixos/tests/all-tests.nix
··· 801 801 nginx-auth = runTest ./nginx-auth.nix; 802 802 nginx-etag = runTest ./nginx-etag.nix; 803 803 nginx-etag-compression = runTest ./nginx-etag-compression.nix; 804 - nginx-globalredirect = handleTest ./nginx-globalredirect.nix {}; 804 + nginx-globalredirect = runTest ./nginx-globalredirect.nix; 805 805 nginx-http3 = handleTest ./nginx-http3.nix {}; 806 806 nginx-mime = handleTest ./nginx-mime.nix {}; 807 807 nginx-modsecurity = handleTest ./nginx-modsecurity.nix {};
+22 -24
nixos/tests/nginx-globalredirect.nix
··· 1 - import ./make-test-python.nix ( 2 - { pkgs, ... }: 3 - { 4 - name = "nginx-globalredirect"; 1 + { ... }: 2 + { 3 + name = "nginx-globalredirect"; 5 4 6 - nodes = { 7 - webserver = 8 - { pkgs, lib, ... }: 9 - { 10 - services.nginx = { 11 - enable = true; 12 - virtualHosts.localhost = { 13 - globalRedirect = "other.example.com"; 14 - # Add an exception 15 - locations."/noredirect".return = "200 'foo'"; 16 - }; 5 + nodes = { 6 + webserver = 7 + { pkgs, lib, ... }: 8 + { 9 + services.nginx = { 10 + enable = true; 11 + virtualHosts.localhost = { 12 + globalRedirect = "other.example.com"; 13 + # Add an exception 14 + locations."/noredirect".return = "200 'foo'"; 17 15 }; 18 16 }; 19 - }; 17 + }; 18 + }; 20 19 21 - testScript = '' 22 - webserver.wait_for_unit("nginx") 23 - webserver.wait_for_open_port(80) 20 + testScript = '' 21 + webserver.wait_for_unit("nginx") 22 + webserver.wait_for_open_port(80) 24 23 25 - webserver.succeed("curl --fail -si http://localhost/alf | grep '^Location:.*/alf'") 26 - webserver.fail("curl --fail -si http://localhost/noredirect | grep '^Location:'") 27 - ''; 28 - } 29 - ) 24 + webserver.succeed("curl --fail -si http://localhost/alf | grep '^Location:.*/alf'") 25 + webserver.fail("curl --fail -si http://localhost/noredirect | grep '^Location:'") 26 + ''; 27 + }