mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-25 17:55:21 +00:00
nixos/tests/systemd-coredump: remove superfluous test case
This test recompiled systemd without coredump to then test that coredumping doesn't work. This is needlessly expensive and doesn't work with our systemd test strategy that overrides config.systemd.package.
This commit is contained in:
@@ -4,15 +4,6 @@ let
|
||||
|
||||
crasher = pkgs.writeCBin "crasher" "int main;";
|
||||
|
||||
commonConfig = {
|
||||
systemd.services.crasher.serviceConfig = {
|
||||
ExecStart = "${crasher}/bin/crasher";
|
||||
StateDirectory = "crasher";
|
||||
WorkingDirectory = "%S/crasher";
|
||||
Restart = "no";
|
||||
};
|
||||
};
|
||||
|
||||
in
|
||||
|
||||
{
|
||||
@@ -21,40 +12,33 @@ in
|
||||
maintainers = [ ];
|
||||
};
|
||||
|
||||
nodes.machine1 =
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
imports = [ commonConfig ];
|
||||
systemd.coredump.settings.Coredump = {
|
||||
nodes.machine = {
|
||||
systemd = {
|
||||
services.crasher.serviceConfig = {
|
||||
ExecStart = "${crasher}/bin/crasher";
|
||||
StateDirectory = "crasher";
|
||||
WorkingDirectory = "%S/crasher";
|
||||
Restart = "no";
|
||||
};
|
||||
|
||||
coredump.settings.Coredump = {
|
||||
Storage = "journal";
|
||||
ProcessSizeMax = "0";
|
||||
};
|
||||
};
|
||||
nodes.machine2 =
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
imports = [ commonConfig ];
|
||||
systemd.coredump.enable = false;
|
||||
systemd.package = pkgs.systemd.override {
|
||||
withCoredump = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
testScript = ''
|
||||
with subtest("systemd-coredump enabled"):
|
||||
machine1.wait_for_unit("multi-user.target")
|
||||
machine1.wait_for_unit("systemd-coredump.socket")
|
||||
machine1.systemctl("start crasher");
|
||||
machine1.wait_until_succeeds("coredumpctl list | grep crasher", timeout=10)
|
||||
machine1.fail("stat /var/lib/crasher/core*")
|
||||
machine.wait_for_unit("multi-user.target")
|
||||
machine.wait_for_unit("systemd-coredump.socket")
|
||||
machine.systemctl("start crasher");
|
||||
machine.wait_until_succeeds("coredumpctl list | grep crasher", timeout=10)
|
||||
machine.fail("stat /var/lib/crasher/core*")
|
||||
|
||||
with subtest("settings.Coredump renders coredump.conf"):
|
||||
machine1.succeed("grep -F '[Coredump]' /etc/systemd/coredump.conf")
|
||||
machine1.succeed("grep -F 'Storage=journal' /etc/systemd/coredump.conf")
|
||||
machine1.succeed("grep -F 'ProcessSizeMax=0' /etc/systemd/coredump.conf")
|
||||
|
||||
with subtest("systemd-coredump disabled"):
|
||||
machine2.systemctl("start crasher");
|
||||
machine2.wait_until_succeeds("stat /var/lib/crasher/core*", timeout=10)
|
||||
machine.succeed("grep -F '[Coredump]' /etc/systemd/coredump.conf")
|
||||
machine.succeed("grep -F 'Storage=journal' /etc/systemd/coredump.conf")
|
||||
machine.succeed("grep -F 'ProcessSizeMax=0' /etc/systemd/coredump.conf")
|
||||
'';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user