diff options
author | Yorick van Pelt <yorick@yorickvanpelt.nl> | 2020-01-23 17:19:53 +0100 |
---|---|---|
committer | Yorick van Pelt <yorick@yorickvanpelt.nl> | 2020-02-10 13:35:14 +0100 |
commit | f003810989c58746db9ea52f6231b4e05d1ecf8c (patch) | |
tree | 8ca491a377cde692c83d736f8ae50e0052c3912b /nixos/tests/buildkite-agents.nix | |
parent | d7e67bf0886e8151cdb90c42327aff9fd89d3087 (diff) |
nixos/buildkite-agents: support multiple buildkite agents
Diffstat (limited to 'nixos/tests/buildkite-agents.nix')
-rw-r--r-- | nixos/tests/buildkite-agents.nix | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/nixos/tests/buildkite-agents.nix b/nixos/tests/buildkite-agents.nix new file mode 100644 index 000000000000..a6f33e0143c5 --- /dev/null +++ b/nixos/tests/buildkite-agents.nix @@ -0,0 +1,31 @@ +import ./make-test-python.nix ({ pkgs, ... }: + +{ + name = "buildkite-agent"; + meta = with pkgs.stdenv.lib.maintainers; { + maintainers = [ flokli ]; + }; + + machine = { pkgs, ... }: { + services.buildkite-agents = { + one = { + privateSshKeyPath = (import ./ssh-keys.nix pkgs).snakeOilPrivateKey; + tokenPath = (pkgs.writeText "my-token" "5678"); + }; + two = { + tokenPath = (pkgs.writeText "my-token" "1234"); + }; + }; + }; + + testScript = '' + start_all() + # we can't wait on the unit to start up, as we obviously can't connect to buildkite, + # but we can look whether files are set up correctly + + machine.wait_for_file("/var/lib/buildkite-agent-one/buildkite-agent.cfg") + machine.wait_for_file("/var/lib/buildkite-agent-one/.ssh/id_rsa") + + machine.wait_for_file("/var/lib/buildkite-agent-two/buildkite-agent.cfg") + ''; +}) |