1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2024-12-14 11:57:34 +00:00

Add some test coverage for redis service

This commit is contained in:
Andrew Seward 2020-11-02 19:26:39 -08:00
parent 58fd716d05
commit fe814c5e91
2 changed files with 27 additions and 0 deletions

View file

@ -121,6 +121,7 @@ let
tests.services-ofborg = makeTest ./tests/services-ofborg.nix; tests.services-ofborg = makeTest ./tests/services-ofborg.nix;
tests.services-offlineimap = makeTest ./tests/services-offlineimap.nix; tests.services-offlineimap = makeTest ./tests/services-offlineimap.nix;
tests.services-privoxy = makeTest ./tests/services-privoxy.nix; tests.services-privoxy = makeTest ./tests/services-privoxy.nix;
tests.services-redis = makeTest ./tests/services-redis.nix;
tests.services-skhd = makeTest ./tests/services-skhd.nix; tests.services-skhd = makeTest ./tests/services-skhd.nix;
tests.services-spacebar = makeTest ./tests/services-spacebar.nix; tests.services-spacebar = makeTest ./tests/services-spacebar.nix;
tests.services-synapse-bt = makeTest ./tests/services-synapse-bt.nix; tests.services-synapse-bt = makeTest ./tests/services-synapse-bt.nix;

26
tests/services-redis.nix Normal file
View file

@ -0,0 +1,26 @@
{ config, lib, pkgs, ... }:
with lib;
let
redis = pkgs.runCommand "redis-0.0.0" {} "mkdir $out";
in
{
services.redis.enable = true;
services.redis.package = redis;
services.redis.extraConfig = ''
maxmemory-policy allkeys-lru
stop-writes-on-bgsave-error no
'';
test = ''
echo >&2 "checking redis service in ~/Library/LaunchAgents"
grep "org.nixos.redis" ${config.out}/user/Library/LaunchAgents/org.nixos.redis.plist
grep "${redis}/bin/redis-server /etc/redis.conf" ${config.out}/user/Library/LaunchAgents/org.nixos.redis.plist
echo >&2 "checking config in /etc/redis.conf"
grep "maxmemory-policy allkeys-lru" ${config.out}/etc/redis.conf
grep "stop-writes-on-bgsave-error no" ${config.out}/etc/redis.conf
'';
}