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