nixpkgs/nixos/tests/buildkite-agents.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
885 B
Nix
Raw Normal View History

2020-01-19 21:50:52 +01:00
import ./make-test-python.nix ({ pkgs, ... }:
{
name = "buildkite-agent";
meta = with pkgs.lib.maintainers; {
2020-01-19 21:50:52 +01:00
maintainers = [ flokli ];
};
2022-03-21 00:15:30 +01:00
nodes.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");
};
2020-01-19 21:50:52 +01:00
};
};
testScript = ''
start_all()
2020-01-19 21:50:52 +01:00
# 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")
2020-01-19 21:50:52 +01:00
'';
})