diff options
author | Arian van Putten <arian.vanputten@gmail.com> | 2023-02-17 12:56:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-17 12:56:24 +0100 |
commit | 98042fc6d36ebb11a4defe4f2cee76aa6192257d (patch) | |
tree | c82a3aa37f9d81cb8c46b474c96f57e9f242a0ca /nixos/tests | |
parent | b3474d78ff4b760be751a83aef7d58c503e3e66d (diff) | |
parent | b1ff1e165821a6842f05cd358a8379ea60bd867b (diff) |
Merge pull request #216357 from nikstur/systemd-repart-after-activation
nixos/systemd-repart: enable running after initrd
Diffstat (limited to 'nixos/tests')
-rw-r--r-- | nixos/tests/systemd-repart.nix | 34 |
1 files changed, 30 insertions, 4 deletions
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 + ''; + }; } |