depot/third_party/nixpkgs/nixos/tests/rsyslogd.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

40 lines
1 KiB
Nix

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