about summary refs log tree commit diff
path: root/nixos/tests/kernel-params.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/tests/kernel-params.nix')
-rw-r--r--nixos/tests/kernel-params.nix24
1 files changed, 24 insertions, 0 deletions
diff --git a/nixos/tests/kernel-params.nix b/nixos/tests/kernel-params.nix
new file mode 100644
index 000000000000..14a393356911
--- /dev/null
+++ b/nixos/tests/kernel-params.nix
@@ -0,0 +1,24 @@
+import ./make-test.nix ({ pkgs, ...} : {
+  name = "kernel-params";
+  meta = with pkgs.stdenv.lib.maintainers; {
+    maintainers = [ nequissimus ];
+  };
+
+  machine = { config, lib, pkgs, ... }:
+    {
+      boot.kernelPackages = pkgs.linuxPackages;
+      boot.kernelParams = [
+        "nohibernate"
+        "page_poison=1"
+        "vsyscall=none"
+      ];
+    };
+
+  testScript =
+    ''
+      $machine->fail("cat /proc/cmdline | grep page_poison=0");
+      $machine->succeed("cat /proc/cmdline | grep nohibernate");
+      $machine->succeed("cat /proc/cmdline | grep page_poison=1");
+      $machine->succeed("cat /proc/cmdline | grep vsyscall=none");
+    '';
+})