nixpkgs-suyu/nixos/tests/kernel-generic.nix

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

43 lines
1.1 KiB
Nix
Raw Normal View History

2021-04-07 17:57:58 +02:00
{ system ? builtins.currentSystem
, config ? { }
, pkgs ? import ../.. { inherit system config; }
}@args:
2021-04-07 17:57:58 +02:00
with pkgs.lib;
let
testsForLinuxPackages = linuxPackages: (import ./make-test-python.nix ({ pkgs, ... }: {
2021-05-02 13:55:33 +02:00
name = "kernel-${linuxPackages.kernel.version}";
2021-04-07 17:57:58 +02:00
meta = with pkgs.lib.maintainers; {
maintainers = [ nequissimus atemu ];
2021-04-07 17:57:58 +02:00
};
2022-03-21 00:15:30 +01:00
nodes.machine = { ... }:
2021-04-07 17:57:58 +02:00
{
boot.kernelPackages = linuxPackages;
};
testScript =
''
assert "Linux" in machine.succeed("uname -s")
2021-04-07 18:28:15 +02:00
assert "${linuxPackages.kernel.modDirVersion}" in machine.succeed("uname -a")
2021-04-07 17:57:58 +02:00
'';
}) args);
kernels = pkgs.linuxKernel.vanillaPackages // {
inherit (pkgs.linuxKernel.packages)
linux_4_14_hardened
linux_4_19_hardened
linux_5_4_hardened
linux_5_10_hardened
linux_5_15_hardened
linux_5_18_hardened
linux_testing;
2021-05-02 13:55:33 +02:00
};
in mapAttrs (_: lP: testsForLinuxPackages lP) kernels // {
inherit testsForLinuxPackages;
testsForKernel = kernel: testsForLinuxPackages (pkgs.linuxPackagesFor kernel);
}