summary refs log tree commit diff
path: root/nixos/tests
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
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')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/buildkite-agent.nix23
2 files changed, 24 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index ceeab2c21d9..eb69457fb7e 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -33,6 +33,7 @@ in
   bind = handleTest ./bind.nix {};
   bittorrent = handleTest ./bittorrent.nix {};
   #blivet = handleTest ./blivet.nix {};   # broken since 2017-07024
+  buildkite-agent = handleTest ./buildkite-agent.nix {};
   boot = handleTestOn ["x86_64-linux"] ./boot.nix {}; # syslinux is unsupported on aarch64
   boot-stage1 = handleTest ./boot-stage1.nix {};
   borgbackup = handleTest ./borgbackup.nix {};
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")
+  '';
+})