1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 11:40:45 +00:00
nixpkgs/nixos/tests/systemd-initrd-modprobe.nix
WilliButz d8eb6d3b97
nixos/tests/systemd-initrd-modprobe: use loadable module
The kernel used on aarch64-linux is built with CONFIG_BLK_DEV_LOOP=y,
so the test previously did not work on aarch64-linux.

The module for Hybla congestion control is available as a loadable
module both on x86_64-linux and aarch64-linux.
2024-05-11 13:04:20 +02:00

25 lines
846 B
Nix

import ./make-test-python.nix ({ lib, pkgs, ... }: {
name = "systemd-initrd-modprobe";
nodes.machine = { pkgs, ... }: {
testing.initrdBackdoor = true;
boot.initrd.systemd.enable = true;
boot.initrd.kernelModules = [ "tcp_hybla" ]; # Load module in initrd.
boot.extraModprobeConfig = ''
options tcp_hybla rtt0=42
'';
};
testScript = ''
machine.wait_for_unit("initrd.target")
rtt = machine.succeed("cat /sys/module/tcp_hybla/parameters/rtt0")
assert int(rtt) == 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")
rtt = machine.succeed("cat /sys/module/tcp_hybla/parameters/rtt0")
assert int(rtt) == 42, "Parameter should be respected for initrd kernel modules"
'';
})