forked from mirrors/nixpkgs
1381019e49
* journald: forward message to syslog by default if a syslog implementation is installed * added a test to ensure rsyslog is receiving messages when expected * added rsyslogd tests to release.nix
38 lines
949 B
Nix
38 lines
949 B
Nix
{ system ? builtins.currentSystem }:
|
|
|
|
with import ../lib/testing.nix { inherit system; };
|
|
{
|
|
test1 = makeTest {
|
|
name = "rsyslogd-test1";
|
|
meta.maintainers = [ 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->waitForUnit("default.target");
|
|
$machine->fail("test -f /var/log/messages");
|
|
'';
|
|
};
|
|
|
|
test2 = makeTest {
|
|
name = "rsyslogd-test2";
|
|
meta.maintainers = [ lib.maintainers.aanderse ];
|
|
|
|
machine =
|
|
{ config, pkgs, ... }:
|
|
{ services.rsyslogd.enable = true;
|
|
};
|
|
|
|
# ensure rsyslogd is receiving messages from journald
|
|
testScript = ''
|
|
$machine->waitForUnit("default.target");
|
|
$machine->succeed("test -f /var/log/messages");
|
|
'';
|
|
};
|
|
}
|