nixos/tests/systemd-repart: do not assume structured journal logs in

tests

systemd-repart and systemd-journal start up in parallel. This means
that quite often systemd-repart ends up logging to /dev/kmesg as opposed
to the journal. 

This makes the tests very flakey (see e.g.
https://hydra.nixos.org/job/nixos/release-25.11/nixos.tests.systemd-repart.after-initrd.x86_64-linux)

Instead we switch to --syslog-identifier which is set for both 
logs in /dev/kmesg and for journal logs
This commit is contained in:
Arian van Putten
2026-02-28 17:54:29 +01:00
parent 636f6c715f
commit 363e3096c7

View File

@@ -110,8 +110,7 @@ in
machine.start()
machine.wait_for_unit("multi-user.target")
systemd_repart_logs = machine.succeed("journalctl --boot --unit systemd-repart.service")
assert "Growing existing partition 1." in systemd_repart_logs
machine.succeed("journalctl --boot --grep 'Growing existing partition 1.' --identifier systemd-repart")
'';
};
@@ -173,8 +172,7 @@ in
machine.start()
machine.wait_for_unit("multi-user.target")
systemd_repart_logs = machine.succeed("journalctl --boot --unit systemd-repart.service")
assert "Encrypting future partition 2" in systemd_repart_logs
machine.succeed("journalctl --boot --grep 'Encrypting future partition 2' --identifier systemd-repart")
assert "/dev/mapper/created-crypt" in machine.succeed("mount")
'';
@@ -205,8 +203,7 @@ in
machine.start()
machine.wait_for_unit("multi-user.target")
systemd_repart_logs = machine.succeed("journalctl --unit systemd-repart.service")
assert "Growing existing partition 1." in systemd_repart_logs
machine.succeed("journalctl --grep 'Growing existing partition 1.' --identifier systemd-repart")
'';
};
@@ -273,8 +270,7 @@ in
machine.start()
machine.wait_for_unit("multi-user.target")
systemd_repart_logs = machine.succeed("journalctl --boot --unit systemd-repart.service")
assert "Adding new partition 2 to partition table." in systemd_repart_logs
machine.succeed("journalctl --boot --grep 'Adding new partition 2 to partition table.' --identifier systemd-repart")
'';
};