2018-10-27 19:01:30 +02:00
|
|
|
{ system ? builtins.currentSystem }:
|
|
|
|
|
|
|
|
with import ../lib/testing.nix { inherit system; };
|
2018-10-30 13:27:44 +01:00
|
|
|
with pkgs.lib;
|
2018-10-27 19:01:30 +02:00
|
|
|
{
|
|
|
|
test1 = makeTest {
|
|
|
|
name = "rsyslogd-test1";
|
2018-10-30 13:27:44 +01:00
|
|
|
meta.maintainers = [ maintainers.aanderse ];
|
2018-10-27 19:01:30 +02:00
|
|
|
|
|
|
|
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";
|
2018-10-30 13:27:44 +01:00
|
|
|
meta.maintainers = [ maintainers.aanderse ];
|
2018-10-27 19:01:30 +02:00
|
|
|
|
|
|
|
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");
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|