Loading nixos/tests/all-tests.nix +1 −0 Original line number Diff line number Diff line Loading @@ -1445,6 +1445,7 @@ in webhook = runTest ./webhook.nix; weblate = handleTest ./web-apps/weblate.nix { }; whisparr = handleTest ./whisparr.nix { }; whoami = runTest ./whoami.nix; whoogle-search = handleTest ./whoogle-search.nix { }; wiki-js = runTest ./wiki-js.nix; wine = handleTest ./wine.nix { }; Loading nixos/tests/whoami.nix 0 → 100644 +32 −0 Original line number Diff line number Diff line { lib, ... }: { name = "echoip"; meta.maintainers = with lib.maintainers; [ defelo ]; nodes.machine = { services.whoami.enable = true; }; interactive.nodes.machine = { networking.firewall.allowedTCPPorts = [ 8000 ]; virtualisation.forwardPorts = [ { from = "host"; host.port = 8000; guest.port = 8000; } ]; }; testScript = '' import re machine.wait_for_unit("whoami.service") machine.wait_for_open_port(8000) response = machine.succeed("curl -H 'X-Test-Header: Hello World!' http://127.0.0.1:8000/test") assert re.search(r"^GET /test", response, re.M) assert re.search(r"^X-Test-Header: Hello World!", response, re.M) ''; } pkgs/by-name/wh/whoami/package.nix +5 −1 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ lib, buildGoModule, fetchFromGitHub, nixosTests, nix-update-script, }: Loading Loading @@ -31,7 +32,10 @@ buildGoModule (finalAttrs: { runHook postInstallCheck ''; passthru.updateScript = nix-update-script { }; passthru = { tests = { inherit (nixosTests) whoami; }; updateScript = nix-update-script { }; }; meta = { description = "Tiny Go server that prints os information and HTTP request to output"; Loading Loading
nixos/tests/all-tests.nix +1 −0 Original line number Diff line number Diff line Loading @@ -1445,6 +1445,7 @@ in webhook = runTest ./webhook.nix; weblate = handleTest ./web-apps/weblate.nix { }; whisparr = handleTest ./whisparr.nix { }; whoami = runTest ./whoami.nix; whoogle-search = handleTest ./whoogle-search.nix { }; wiki-js = runTest ./wiki-js.nix; wine = handleTest ./wine.nix { }; Loading
nixos/tests/whoami.nix 0 → 100644 +32 −0 Original line number Diff line number Diff line { lib, ... }: { name = "echoip"; meta.maintainers = with lib.maintainers; [ defelo ]; nodes.machine = { services.whoami.enable = true; }; interactive.nodes.machine = { networking.firewall.allowedTCPPorts = [ 8000 ]; virtualisation.forwardPorts = [ { from = "host"; host.port = 8000; guest.port = 8000; } ]; }; testScript = '' import re machine.wait_for_unit("whoami.service") machine.wait_for_open_port(8000) response = machine.succeed("curl -H 'X-Test-Header: Hello World!' http://127.0.0.1:8000/test") assert re.search(r"^GET /test", response, re.M) assert re.search(r"^X-Test-Header: Hello World!", response, re.M) ''; }
pkgs/by-name/wh/whoami/package.nix +5 −1 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ lib, buildGoModule, fetchFromGitHub, nixosTests, nix-update-script, }: Loading Loading @@ -31,7 +32,10 @@ buildGoModule (finalAttrs: { runHook postInstallCheck ''; passthru.updateScript = nix-update-script { }; passthru = { tests = { inherit (nixosTests) whoami; }; updateScript = nix-update-script { }; }; meta = { description = "Tiny Go server that prints os information and HTTP request to output"; Loading