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