depot/third_party/nixpkgs/nixos/tests/flood.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

27 lines
566 B
Nix

import ./make-test-python.nix ({ pkgs, ... }:
let
port = 3001;
in
{
name = "flood";
meta = {
maintainers = with pkgs.lib.maintainers; [ thiagokokada ];
};
nodes.machine = { pkgs, ... }: {
services.flood = {
inherit port;
enable = true;
openFirewall = true;
extraArgs = [ "--baseuri=/" ];
};
};
testScript = /* python */ ''
machine.start()
machine.wait_for_unit("flood.service")
machine.wait_for_open_port(${toString port})
machine.succeed("curl --fail http://localhost:${toString port}")
'';
})