1 import ./make-test-python.nix ({ pkgs, ... }:
5 crasher = pkgs.writeCBin "crasher" "int main;";
8 systemd.services.crasher.serviceConfig = {
9 ExecStart = "${crasher}/bin/crasher";
10 StateDirectory = "crasher";
11 WorkingDirectory = "%S/crasher";
19 name = "systemd-coredump";
20 meta = with pkgs.lib.maintainers; {
21 maintainers = [ squalus ];
24 nodes.machine1 = { pkgs, lib, ... }: commonConfig;
25 nodes.machine2 = { pkgs, lib, ... }: lib.recursiveUpdate commonConfig {
26 systemd.coredump.enable = false;
27 systemd.package = pkgs.systemd.override {
33 with subtest("systemd-coredump enabled"):
34 machine1.wait_for_unit("multi-user.target")
35 machine1.wait_for_unit("systemd-coredump.socket")
36 machine1.systemctl("start crasher");
37 machine1.wait_until_succeeds("coredumpctl list | grep crasher", timeout=10)
38 machine1.fail("stat /var/lib/crasher/core")
40 with subtest("systemd-coredump disabled"):
41 machine2.systemctl("start crasher");
42 machine2.wait_until_succeeds("stat /var/lib/crasher/core", timeout=10)