2022-10-05 03:37:51 +03:00
|
|
|
import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
|
|
|
name = "systemd-initrd-modprobe";
|
|
|
|
|
|
|
|
nodes.machine = { pkgs, ... }: {
|
2023-09-20 13:26:03 +03:00
|
|
|
testing.initrdBackdoor = true;
|
2022-10-05 03:37:51 +03:00
|
|
|
boot.initrd.systemd.enable = true;
|
2024-05-11 13:54:36 +03:00
|
|
|
boot.initrd.kernelModules = [ "tcp_hybla" ]; # Load module in initrd.
|
2022-10-05 03:37:51 +03:00
|
|
|
boot.extraModprobeConfig = ''
|
2024-05-11 13:54:36 +03:00
|
|
|
options tcp_hybla rtt0=42
|
2022-10-05 03:37:51 +03:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2023-09-20 13:26:03 +03:00
|
|
|
machine.wait_for_unit("initrd.target")
|
2024-05-11 13:54:36 +03:00
|
|
|
rtt = machine.succeed("cat /sys/module/tcp_hybla/parameters/rtt0")
|
|
|
|
assert int(rtt) == 42, "Parameter should be respected for initrd kernel modules"
|
2023-09-20 13:26:03 +03:00
|
|
|
|
|
|
|
# Make sure it sticks in stage 2
|
|
|
|
machine.switch_root()
|
2022-10-05 03:37:51 +03:00
|
|
|
machine.wait_for_unit("multi-user.target")
|
2024-05-11 13:54:36 +03:00
|
|
|
rtt = machine.succeed("cat /sys/module/tcp_hybla/parameters/rtt0")
|
|
|
|
assert int(rtt) == 42, "Parameter should be respected for initrd kernel modules"
|
2022-10-05 03:37:51 +03:00
|
|
|
'';
|
|
|
|
})
|