nixos/tests/systemd-initrd-modprobe: Test parameter in stage 1
This commit is contained in:
parent
b41cbee0fd
commit
e9e2240763
1 changed files with 7 additions and 0 deletions
|
@ -2,6 +2,7 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
||||||
name = "systemd-initrd-modprobe";
|
name = "systemd-initrd-modprobe";
|
||||||
|
|
||||||
nodes.machine = { pkgs, ... }: {
|
nodes.machine = { pkgs, ... }: {
|
||||||
|
testing.initrdBackdoor = true;
|
||||||
boot.initrd.systemd.enable = true;
|
boot.initrd.systemd.enable = true;
|
||||||
boot.initrd.kernelModules = [ "loop" ]; # Load module in initrd.
|
boot.initrd.kernelModules = [ "loop" ]; # Load module in initrd.
|
||||||
boot.extraModprobeConfig = ''
|
boot.extraModprobeConfig = ''
|
||||||
|
@ -10,6 +11,12 @@ import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
||||||
};
|
};
|
||||||
|
|
||||||
testScript = ''
|
testScript = ''
|
||||||
|
machine.wait_for_unit("initrd.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"
|
||||||
|
|
||||||
|
# Make sure it sticks in stage 2
|
||||||
|
machine.switch_root()
|
||||||
machine.wait_for_unit("multi-user.target")
|
machine.wait_for_unit("multi-user.target")
|
||||||
max_loop = machine.succeed("cat /sys/module/loop/parameters/max_loop")
|
max_loop = machine.succeed("cat /sys/module/loop/parameters/max_loop")
|
||||||
assert int(max_loop) == 42, "Parameter should be respected for initrd kernel modules"
|
assert int(max_loop) == 42, "Parameter should be respected for initrd kernel modules"
|
||||||
|
|
Loading…
Reference in a new issue