nixpkgs-suyu/nixos/tests/kernel-generic.nix
2021-08-23 19:57:46 +02:00

44 lines
1 KiB
Nix

{ system ? builtins.currentSystem
, config ? { }
, pkgs ? import ../.. { inherit system config; }
}@args:
with pkgs.lib;
let
makeKernelTest = linuxPackages: (import ./make-test-python.nix ({ pkgs, ... }: {
name = "kernel-${linuxPackages.kernel.version}";
meta = with pkgs.lib.maintainers; {
maintainers = [ nequissimus ];
};
machine = { ... }:
{
boot.kernelPackages = linuxPackages;
};
testScript =
''
assert "Linux" in machine.succeed("uname -s")
assert "${linuxPackages.kernel.modDirVersion}" in machine.succeed("uname -a")
'';
}) args);
kernels = {
inherit (pkgs)
linuxPackages_4_4
linuxPackages_4_9
linuxPackages_4_14
linuxPackages_4_19
linuxPackages_5_4
linuxPackages_5_10
linuxPackages_5_13
linuxPackages_4_14_hardened
linuxPackages_4_19_hardened
linuxPackages_5_4_hardened
linuxPackages_5_10_hardened
linuxPackages_testing;
};
in mapAttrs (_: kernel: makeKernelTest kernel) kernels