From 2b80bf0b34a2913ff111d53ef7bce95ce8ae462a Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Mon, 15 Sep 2025 17:21:21 +0000 Subject: [PATCH] nixos/systemd: Add package version tests to integration tests --- nixos/tests/systemd.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nixos/tests/systemd.nix b/nixos/tests/systemd.nix index 1209a90cbc43..fbece2a73dfc 100644 --- a/nixos/tests/systemd.nix +++ b/nixos/tests/systemd.nix @@ -1,4 +1,4 @@ -{ pkgs, ... }: +{ lib, pkgs, ... }: { name = "systemd"; @@ -108,6 +108,14 @@ # Will not succeed unless ConditionFirstBoot=yes machine.wait_for_unit("first-boot-complete.target") + machine.succeed( + "journalctl --system -o cat --grep 'systemd ${lib.escapeRegex pkgs.systemd.version} running'" + ) + + assert "systemd ${lib.versions.major pkgs.systemd.version} (${pkgs.systemd.version})" in machine.succeed( + "systemctl --version" + ) + # Make sure, a subsequent boot isn't a ConditionFirstBoot=yes. machine.reboot() machine.wait_for_x()