nixpkgs/nixos/tests/kernel-generic.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

67 lines
1.5 KiB
Nix
Raw Normal View History

2021-04-07 15:57:58 +00:00
{
system ? builtins.currentSystem,
config ? { },
pkgs ? import ../.. { inherit system config; },
}@args:
2021-04-07 15:57:58 +00:00
with pkgs.lib;
let
testsForLinuxPackages =
linuxPackages:
(import ./make-test-python.nix (
{ pkgs, ... }:
2021-04-07 15:57:58 +00:00
{
2021-05-02 11:55:33 +00:00
name = "kernel-${linuxPackages.kernel.version}";
2021-04-07 15:57:58 +00:00
meta = with pkgs.lib.maintainers; {
maintainers = [
nequissimus
atemu
ma27
];
};
2022-03-20 23:15:30 +00:00
nodes.machine =
{ ... }:
{
2021-04-07 15:57:58 +00:00
boot.kernelPackages = linuxPackages;
};
2021-04-07 15:57:58 +00:00
testScript = ''
assert "Linux" in machine.succeed("uname -s")
2021-04-07 16:28:15 +00:00
assert "${linuxPackages.kernel.modDirVersion}" in machine.succeed("uname -a")
2021-04-07 15:57:58 +00:00
'';
}
) args);
kernels = pkgs.linuxKernel.vanillaPackages // {
inherit (pkgs.linuxKernel.packages)
linux_5_4_hardened
linux_5_10_hardened
linux_5_15_hardened
linux_6_1_hardened
linux_6_6_hardened
linux_6_11_hardened
linux_rt_5_4
linux_rt_5_10
linux_rt_5_15
linux_rt_6_1
linux_rt_6_6
linux_libre
linux_testing
;
2021-05-02 11:55:33 +00:00
};
in
mapAttrs (_: lP: testsForLinuxPackages lP) kernels
// {
passthru = {
inherit testsForLinuxPackages;
# Useful for development testing of all Kernel configs without building full Kernel
configfiles = mapAttrs (_: lP: lP.kernel.configfile) kernels;
testsForKernel = kernel: testsForLinuxPackages (pkgs.linuxPackagesFor kernel);
};
}