Allow overriding all NixOS tests to run with the minimal kernel possible for that test's config(s) (based on requiredKernelConfig)

This commit is contained in:
Shea Levy
2012-08-04 09:45:26 -04:00
parent feb010a366
commit 1b615f460b
6 changed files with 37 additions and 47 deletions

View File

@@ -1,6 +1,6 @@
{ system ? builtins.currentSystem }:
{ system ? builtins.currentSystem, minimal ? false }:
with import ../lib/testing.nix { inherit system; };
with import ../lib/testing.nix { inherit system minimal; };
{
avahi = makeTest (import ./avahi.nix);
@@ -11,7 +11,6 @@ with import ../lib/testing.nix { inherit system; };
ipv6 = makeTest (import ./ipv6.nix);
kde4 = makeTest (import ./kde4.nix);
login = makeTest (import ./login.nix);
minimal_kernel = makeTest (import ./minimal-kernel.nix);
misc = makeTest (import ./misc.nix);
mpich = makeTest (import ./mpich.nix);
mysql = makeTest (import ./mysql.nix);

View File

@@ -1,37 +0,0 @@
{ pkgs, ... }:
{
machine = { config, pkgs, ... }:
let
configfile = builtins.storePath (builtins.toFile "config" (pkgs.lib.concatStringsSep "\n"
(map (builtins.getAttr "configLine") config.system.requiredKernelConfig)));
origKernel = pkgs.linuxManualConfig {
inherit (pkgs.linux) src version;
inherit configfile;
allowImportFromDerivation = true;
kernelPatches = [ pkgs.kernelPatches.cifs_timeout_2_6_38 ];
};
kernel = origKernel //(derivation (origKernel.drvAttrs // {
configurePhase = ''
runHook preConfigure
mkdir ../build
make $makeFlags "''${makeFlagsArray[@]}" mrproper
make $makeFlags "''${makeFlagsArray[@]}" KCONFIG_ALLCONFIG=${configfile} allnoconfig
runHook postConfigure
'';
}));
kernelPackages = pkgs.linuxPackagesFor kernel kernelPackages;
in {
boot.kernelPackages = kernelPackages;
};
testScript =
''
startAll;
$machine->shutdown;
'';
}