about summary refs log tree commit diff
path: root/nixos/tests/systemd-initrd-modprobe.nix
blob: bf635a10d0e97630aa3e4100b6b62a9e9b2cee4b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import ./make-test-python.nix ({ lib, pkgs, ... }: {
  name = "systemd-initrd-modprobe";

  nodes.machine = { pkgs, ... }: {
    boot.initrd.systemd.enable = true;
    boot.initrd.kernelModules = [ "loop" ]; # Load module in initrd.
    boot.extraModprobeConfig = ''
      options loop max_loop=42
    '';
  };

  testScript = ''
    machine.wait_for_unit("multi-user.target")
    max_loop = machine.succeed("cat /sys/module/loop/parameters/max_loop")
    assert int(max_loop) == 42, "Parameter should be respected for initrd kernel modules"
  '';
})