1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs synced 2024-10-19 03:47:13 -04:00
nixpkgs/nixos/tests/rsyslogd.nix

41 lines
1 KiB
Nix
Raw Normal View History

{ system ? builtins.currentSystem,
config ? {},
pkgs ? import ../.. { inherit system config; }
}:
2020-02-14 02:32:28 -05:00
with import ../lib/testing-python.nix { inherit system pkgs; };
2018-10-30 08:27:44 -04:00
with pkgs.lib;
{
test1 = makeTest {
name = "rsyslogd-test1";
2020-02-14 02:32:28 -05:00
meta.maintainers = [ pkgs.stdenv.lib.maintainers.aanderse ];
2020-02-14 02:32:28 -05:00
machine = { config, pkgs, ... }: {
services.rsyslogd.enable = true;
services.journald.forwardToSyslog = false;
};
# ensure rsyslogd isn't receiving messages from journald if explicitly disabled
testScript = ''
2020-02-14 02:32:28 -05:00
machine.wait_for_unit("default.target")
machine.fail("test -f /var/log/messages")
'';
};
test2 = makeTest {
name = "rsyslogd-test2";
2020-02-14 02:32:28 -05:00
meta.maintainers = [ pkgs.stdenv.lib.maintainers.aanderse ];
2020-02-14 02:32:28 -05:00
machine = { config, pkgs, ... }: {
services.rsyslogd.enable = true;
};
# ensure rsyslogd is receiving messages from journald
testScript = ''
2020-02-14 02:32:28 -05:00
machine.wait_for_unit("default.target")
machine.succeed("test -f /var/log/messages")
'';
};
}