2022-10-05 02:37:51 +02:00
|
|
|
import ./make-test-python.nix ({ lib, pkgs, ... }: {
|
|
|
|
name = "systemd-initrd-modprobe";
|
|
|
|
|
|
|
|
nodes.machine = { pkgs, ... }: {
|
2023-09-20 12:26:03 +02:00
|
|
|
testing.initrdBackdoor = true;
|
2022-10-05 02:37:51 +02:00
|
|
|
boot.initrd.systemd.enable = true;
|
2024-05-11 12:54:36 +02:00
|
|
|
boot.initrd.kernelModules = [ "tcp_hybla" ]; # Load module in initrd.
|
2022-10-05 02:37:51 +02:00
|
|
|
boot.extraModprobeConfig = ''
|
2024-05-11 12:54:36 +02:00
|
|
|
options tcp_hybla rtt0=42
|
2022-10-05 02:37:51 +02:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
testScript = ''
|
2023-09-20 12:26:03 +02:00
|
|
|
machine.wait_for_unit("initrd.target")
|
2024-05-11 12:54:36 +02: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 12:26:03 +02:00
|
|
|
|
|
|
|
# Make sure it sticks in stage 2
|
|
|
|
machine.switch_root()
|
2022-10-05 02:37:51 +02:00
|
|
|
machine.wait_for_unit("multi-user.target")
|
2024-05-11 12:54:36 +02: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 02:37:51 +02:00
|
|
|
'';
|
|
|
|
})
|