From b1ff1e165821a6842f05cd358a8379ea60bd867b Mon Sep 17 00:00:00 2001 From: nikstur Date: Tue, 14 Feb 2023 19:39:08 +0100 Subject: nixos/systemd-repart: enable running after initrd --- nixos/tests/systemd-repart.nix | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'nixos/tests') diff --git a/nixos/tests/systemd-repart.nix b/nixos/tests/systemd-repart.nix index 92cc1fb04edc0..36de5d988fdb1 100644 --- a/nixos/tests/systemd-repart.nix +++ b/nixos/tests/systemd-repart.nix @@ -52,9 +52,6 @@ let }; }; - boot.initrd.systemd.enable = true; - boot.initrd.systemd.repart.enable = true; - # systemd-repart operates on disks with a partition table. The qemu module, # however, creates separate filesystem images without a partition table, so # we have to create a disk image manually. @@ -88,7 +85,10 @@ in nodes.machine = { config, pkgs, ... }: { imports = [ common ]; - boot.initrd.systemd.repart.partitions = { + boot.initrd.systemd.enable = true; + + boot.initrd.systemd.repart.enable = true; + systemd.repart.partitions = { "10-root" = { Type = "linux-generic"; }; @@ -105,4 +105,30 @@ in assert "Growing existing partition 1." in systemd_repart_logs ''; }; + + after-initrd = makeTest { + name = "systemd-repart-after-initrd"; + meta.maintainers = with maintainers; [ nikstur ]; + + nodes.machine = { config, pkgs, ... }: { + imports = [ common ]; + + systemd.repart.enable = true; + systemd.repart.partitions = { + "10-root" = { + Type = "linux-generic"; + }; + }; + }; + + testScript = { nodes, ... }: '' + ${useDiskImage nodes.machine} + + 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 + ''; + }; } -- cgit 1.4.1