1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-21 05:00:16 +00:00
nixpkgs/nixos/tests/kernel-generic.nix

49 lines
1.2 KiB
Nix
Raw Normal View History

2021-04-07 16:57:58 +01:00
{ system ? builtins.currentSystem
, config ? { }
, pkgs ? import ../.. { inherit system config; }
}@args:
2021-04-07 16:57:58 +01:00
with pkgs.lib;
let
testsForLinuxPackages = linuxPackages: (import ./make-test-python.nix ({ pkgs, ... }: {
2021-05-02 12:55:33 +01:00
name = "kernel-${linuxPackages.kernel.version}";
2021-04-07 16:57:58 +01:00
meta = with pkgs.lib.maintainers; {
maintainers = [ nequissimus atemu ];
2021-04-07 16:57:58 +01:00
};
machine = { ... }:
{
boot.kernelPackages = linuxPackages;
};
testScript =
''
assert "Linux" in machine.succeed("uname -s")
2021-04-07 17:28:15 +01:00
assert "${linuxPackages.kernel.modDirVersion}" in machine.succeed("uname -a")
2021-04-07 16:57:58 +01:00
'';
}) args);
2021-05-02 12:55:33 +01:00
kernels = {
inherit (pkgs)
linuxPackages_4_4
linuxPackages_4_9
linuxPackages_4_14
linuxPackages_4_19
linuxPackages_5_4
linuxPackages_5_10
linuxPackages_5_14
2021-04-07 17:28:15 +01:00
2021-05-02 12:55:33 +01:00
linuxPackages_4_14_hardened
linuxPackages_4_19_hardened
linuxPackages_5_4_hardened
linuxPackages_5_10_hardened
2021-05-02 12:55:33 +01:00
linuxPackages_testing;
};
in mapAttrs (_: lP: testsForLinuxPackages lP) kernels // {
inherit testsForLinuxPackages;
testsForKernel = kernel: testsForLinuxPackages (pkgs.linuxPackagesFor kernel);
}