From 3e2975e892527fe45e4f574401cb7d19eb9542a6 Mon Sep 17 00:00:00 2001 From: Tim Steinbach Date: Tue, 5 Sep 2017 19:04:43 -0400 Subject: [PATCH] tests: Add kernelParams --- nixos/release-combined.nix | 1 + nixos/release.nix | 1 + nixos/tests/kernel-params.nix | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 nixos/tests/kernel-params.nix diff --git a/nixos/release-combined.nix b/nixos/release-combined.nix index 30f5f96dc505..f820c0408017 100644 --- a/nixos/release-combined.nix +++ b/nixos/release-combined.nix @@ -93,6 +93,7 @@ in rec { (all nixos.tests.plasma5) (all nixos.tests.kernel-latest) (all nixos.tests.kernel-lts) + (all nixos.tests.kernel-params) #(all nixos.tests.lightdm) (all nixos.tests.login) (all nixos.tests.misc) diff --git a/nixos/release.nix b/nixos/release.nix index c557349a3264..6348c2f15d4c 100644 --- a/nixos/release.nix +++ b/nixos/release.nix @@ -264,6 +264,7 @@ in rec { tests.kernel-copperhead = tests/kernel-copperhead.nix {}; tests.kernel-latest = tests/kernel-latest.nix {}; tests.kernel-lts = tests/kernel-lts.nix {}; + tests.kernel-params = tests/kernel-params.nix {}; tests.keystone = callTest tests/keystone.nix {}; tests.kubernetes = hydraJob (import tests/kubernetes.nix { system = "x86_64-linux"; }); tests.latestKernel.login = callTest tests/login.nix { latestKernel = true; }; 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"); + ''; +})