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