summary refs log tree commit diff
path: root/nixos/tests
diff options
context:
space:
mode:
authorScott Worley <scottworley@scottworley.com>2020-11-23 17:53:21 -0800
committerChuck <chuck@intelligence.org>2020-12-10 12:59:13 -0800
commite0e08a186dbec9ccaaace0c0b939e901c3893aa7 (patch)
treedfdedb324673f13315bfff1e11cfb0646cdee1e0 /nixos/tests
parente0d27cfb310d0a0c24eab004b5284668f7df1381 (diff)
downloadnixpkgs-e0e08a186dbec9ccaaace0c0b939e901c3893aa7.tar
nixpkgs-e0e08a186dbec9ccaaace0c0b939e901c3893aa7.tar.gz
nixpkgs-e0e08a186dbec9ccaaace0c0b939e901c3893aa7.tar.bz2
nixpkgs-e0e08a186dbec9ccaaace0c0b939e901c3893aa7.tar.lz
nixpkgs-e0e08a186dbec9ccaaace0c0b939e901c3893aa7.tar.xz
nixpkgs-e0e08a186dbec9ccaaace0c0b939e901c3893aa7.tar.zst
nixpkgs-e0e08a186dbec9ccaaace0c0b939e901c3893aa7.zip
nixos/locate: Add a test
Diffstat (limited to 'nixos/tests')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/locate.nix21
2 files changed, 22 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 640cc84c803..feb5c98f3d2 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -190,6 +190,7 @@ in
   lidarr = handleTest ./lidarr.nix {};
   lightdm = handleTest ./lightdm.nix {};
   limesurvey = handleTest ./limesurvey.nix {};
+  locate = handleTest ./locate.nix {};
   login = handleTest ./login.nix {};
   loki = handleTest ./loki.nix {};
   lxd = handleTest ./lxd.nix {};
diff --git a/nixos/tests/locate.nix b/nixos/tests/locate.nix
new file mode 100644
index 00000000000..d351410be30
--- /dev/null
+++ b/nixos/tests/locate.nix
@@ -0,0 +1,21 @@
+import ./make-test-python.nix ({ lib, pkgs, ... }:
+  let inherit (import ./ssh-keys.nix pkgs) snakeOilPrivateKey snakeOilPublicKey;
+  in {
+    name = "locate";
+    meta.maintainers = with pkgs.stdenv.lib.maintainers; [ chkno ];
+
+    nodes = rec {
+      a = {
+        services.locate = {
+          enable = true;
+          interval = "*:*:0/5";
+        };
+      };
+    };
+
+    testScript = ''
+      a.succeed("touch /file-on-a-machine-1")
+      a.wait_for_file("/var/cache/locatedb")
+      a.wait_until_succeeds("locate file-on-a-machine-1")
+    '';
+  })