mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 07:01:54 +00:00
Merge pull request #80096 from tfc/port-rsyslogd-test
nixosTests.rsyslogd: Port to python
This commit is contained in:
commit
d6587c0444
@ -3,40 +3,38 @@
|
|||||||
pkgs ? import ../.. { inherit system config; }
|
pkgs ? import ../.. { inherit system config; }
|
||||||
}:
|
}:
|
||||||
|
|
||||||
with import ../lib/testing.nix { inherit system pkgs; };
|
with import ../lib/testing-python.nix { inherit system pkgs; };
|
||||||
with pkgs.lib;
|
with pkgs.lib;
|
||||||
|
|
||||||
{
|
{
|
||||||
test1 = makeTest {
|
test1 = makeTest {
|
||||||
name = "rsyslogd-test1";
|
name = "rsyslogd-test1";
|
||||||
meta.maintainers = [ maintainers.aanderse ];
|
meta.maintainers = [ pkgs.stdenv.lib.maintainers.aanderse ];
|
||||||
|
|
||||||
machine =
|
machine = { config, pkgs, ... }: {
|
||||||
{ config, pkgs, ... }:
|
services.rsyslogd.enable = true;
|
||||||
{ services.rsyslogd.enable = true;
|
|
||||||
services.journald.forwardToSyslog = false;
|
services.journald.forwardToSyslog = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# ensure rsyslogd isn't receiving messages from journald if explicitly disabled
|
# ensure rsyslogd isn't receiving messages from journald if explicitly disabled
|
||||||
testScript = ''
|
testScript = ''
|
||||||
$machine->waitForUnit("default.target");
|
machine.wait_for_unit("default.target")
|
||||||
$machine->fail("test -f /var/log/messages");
|
machine.fail("test -f /var/log/messages")
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
test2 = makeTest {
|
test2 = makeTest {
|
||||||
name = "rsyslogd-test2";
|
name = "rsyslogd-test2";
|
||||||
meta.maintainers = [ maintainers.aanderse ];
|
meta.maintainers = [ pkgs.stdenv.lib.maintainers.aanderse ];
|
||||||
|
|
||||||
machine =
|
machine = { config, pkgs, ... }: {
|
||||||
{ config, pkgs, ... }:
|
services.rsyslogd.enable = true;
|
||||||
{ services.rsyslogd.enable = true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
# ensure rsyslogd is receiving messages from journald
|
# ensure rsyslogd is receiving messages from journald
|
||||||
testScript = ''
|
testScript = ''
|
||||||
$machine->waitForUnit("default.target");
|
machine.wait_for_unit("default.target")
|
||||||
$machine->succeed("test -f /var/log/messages");
|
machine.succeed("test -f /var/log/messages")
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user