summaryrefslogtreecommitdiffstats
path: root/nixos
diff options
context:
space:
mode:
authoroxalica <oxalicc@pm.me>2022-10-05 08:37:51 +0800
committeroxalica <oxalicc@pm.me>2022-10-05 08:37:51 +0800
commit3c92009868109ec8a3695d2ebacf0b53e23778d1 (patch)
tree62346eb0667bb872c5618e27ee356fb64ae84d1a /nixos
parentc5c42d4fbe0c68bb79f6178b4c39271275bb4298 (diff)
nixos/tests/systemd-initrd-modprobe: init
Diffstat (limited to 'nixos')
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/systemd-initrd-modprobe.nix17
2 files changed, 18 insertions, 0 deletions
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index e0121fe6b6b8..b49be62b24b7 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -556,6 +556,7 @@ in {
systemd-initrd-btrfs-raid = handleTest ./systemd-initrd-btrfs-raid.nix {};
systemd-initrd-luks-keyfile = handleTest ./systemd-initrd-luks-keyfile.nix {};
systemd-initrd-luks-password = handleTest ./systemd-initrd-luks-password.nix {};
+ systemd-initrd-modprobe = handleTest ./systemd-initrd-modprobe.nix {};
systemd-initrd-shutdown = handleTest ./systemd-shutdown.nix { systemdStage1 = true; };
systemd-initrd-simple = handleTest ./systemd-initrd-simple.nix {};
systemd-initrd-swraid = handleTest ./systemd-initrd-swraid.nix {};
diff --git a/nixos/tests/systemd-initrd-modprobe.nix b/nixos/tests/systemd-initrd-modprobe.nix
new file mode 100644
index 000000000000..bf635a10d0e9
--- /dev/null
+++ b/nixos/tests/systemd-initrd-modprobe.nix
@@ -0,0 +1,17 @@
+import ./make-test-python.nix ({ lib, pkgs, ... }: {
+ name = "systemd-initrd-modprobe";
+
+ nodes.machine = { pkgs, ... }: {
+ boot.initrd.systemd.enable = true;
+ boot.initrd.kernelModules = [ "loop" ]; # Load module in initrd.
+ boot.extraModprobeConfig = ''
+ options loop max_loop=42
+ '';
+ };
+
+ testScript = ''
+ machine.wait_for_unit("multi-user.target")
+ max_loop = machine.succeed("cat /sys/module/loop/parameters/max_loop")
+ assert int(max_loop) == 42, "Parameter should be respected for initrd kernel modules"
+ '';
+})