1 import ./make-test-python.nix ({ pkgs, ... }:
4 meta = with pkgs.lib.maintainers; {
5 maintainers = [ flokli ];
10 { pkgs, lib, ... }: with lib;
13 services.redis.servers."".enable = true;
14 services.redis.servers."test".enable = true;
16 users.users = listToAttrs (map (suffix: nameValuePair "member${suffix}" {
18 description = "A member of the redis${suffix} group";
20 extraGroups = [ "redis${suffix}" ];
25 testScript = { nodes, ... }: let
26 inherit (nodes.machine.config.services) redis;
29 machine.wait_for_unit("redis")
30 machine.wait_for_unit("redis-test")
32 # The unnamed Redis server still opens a port for backward-compatibility
33 machine.wait_for_open_port(6379)
35 machine.wait_for_file("${redis.servers."".unixSocket}")
36 machine.wait_for_file("${redis.servers."test".unixSocket}")
38 # The unix socket is accessible to the redis group
39 machine.succeed('su member -c "redis-cli ping | grep PONG"')
40 machine.succeed('su member-test -c "redis-cli ping | grep PONG"')
42 machine.succeed("redis-cli ping | grep PONG")
43 machine.succeed("redis-cli -s ${redis.servers."".unixSocket} ping | grep PONG")
44 machine.succeed("redis-cli -s ${redis.servers."test".unixSocket} ping | grep PONG")