about summary refs log tree commit diff
path: root/nixos/tests/redis.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2019-08-31 20:17:33 +0200
committerFlorian Klink <flokli@flokli.de>2019-09-01 14:13:01 +0200
commitc00c4b1940afe842675e32b2e69c3b13f7035643 (patch)
tree5de9fd6b7d24832323cac8495d5d5da2810cd0e3 /nixos/tests/redis.nix
parent8680f72c880fcf573b42e9203339653a9af411bc (diff)
nixos/redis: add test
Diffstat (limited to 'nixos/tests/redis.nix')
-rw-r--r--nixos/tests/redis.nix26
1 files changed, 26 insertions, 0 deletions
diff --git a/nixos/tests/redis.nix b/nixos/tests/redis.nix
new file mode 100644
index 0000000000000..325d93424dd7d
--- /dev/null
+++ b/nixos/tests/redis.nix
@@ -0,0 +1,26 @@
+import ./make-test.nix ({ pkgs, ...} : {
+  name = "redis";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ flokli ];
+  };
+
+  nodes = {
+    machine =
+      { pkgs, ... }:
+
+      {
+        services.redis.enable = true;
+        services.redis.unixSocket = "/run/redis/redis.sock";
+      };
+  };
+
+  testScript = ''
+    startAll;
+
+    $machine->waitForUnit("redis");
+    $machine->waitForOpenPort("6379");
+
+    $machine->succeed("redis-cli ping | grep PONG");
+    $machine->succeed("redis-cli -s /run/redis/redis.sock ping | grep PONG");
+  '';
+})