summary refs log tree commit diff
path: root/nixos/tests/buildkite-agent.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-01-19 21:50:52 +0100
committerFlorian Klink <flokli@flokli.de>2020-01-20 10:30:24 +0100
commita208e6eb994b997542528371ffa483c7deda98fe (patch)
treef826a9f3a70fe7927e78cfb2e53581a9c1305115 /nixos/tests/buildkite-agent.nix
parent70308a7daf3e1d555de42f7bb557caa4fdd8b542 (diff)
downloadnixpkgs-a208e6eb994b997542528371ffa483c7deda98fe.tar
nixpkgs-a208e6eb994b997542528371ffa483c7deda98fe.tar.gz
nixpkgs-a208e6eb994b997542528371ffa483c7deda98fe.tar.bz2
nixpkgs-a208e6eb994b997542528371ffa483c7deda98fe.tar.lz
nixpkgs-a208e6eb994b997542528371ffa483c7deda98fe.tar.xz
nixpkgs-a208e6eb994b997542528371ffa483c7deda98fe.tar.zst
nixpkgs-a208e6eb994b997542528371ffa483c7deda98fe.zip
nixosTests.buildkite: add test
Diffstat (limited to 'nixos/tests/buildkite-agent.nix')
-rw-r--r--nixos/tests/buildkite-agent.nix23
1 files changed, 23 insertions, 0 deletions
diff --git a/nixos/tests/buildkite-agent.nix b/nixos/tests/buildkite-agent.nix
new file mode 100644
index 00000000000..042ce389eb8
--- /dev/null
+++ b/nixos/tests/buildkite-agent.nix
@@ -0,0 +1,23 @@
+import ./make-test-python.nix ({ pkgs, ... }:
+
+{
+  name = "buildkite-agent";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ flokli ];
+  };
+
+  machine = { pkgs, ... }: {
+    services.buildkite-agent = {
+      enable = true;
+      privateSshKeyPath = (import ./ssh-keys.nix pkgs).snakeOilPrivateKey;
+      tokenPath = (pkgs.writeText "my-token" "5678");
+    };
+  };
+
+  testScript = ''
+    # 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/buildkite-agent.cfg")
+    machine.wait_for_file("/var/lib/buildkite-agent/.ssh/id_rsa")
+  '';
+})