1{ system ? builtins.currentSystem
2, config ? { }
3, pkgs ? import ../.. { inherit system config; }
4}@args:
5
6with pkgs.lib;
7
8let
9 testsForLinuxPackages = linuxPackages: (import ./make-test-python.nix ({ pkgs, ... }: {
10 name = "kernel-${linuxPackages.kernel.version}";
11 meta = with pkgs.lib.maintainers; {
12 maintainers = [ nequissimus atemu ma27 ];
13 };
14
15 nodes.machine = { ... }:
16 {
17 boot.kernelPackages = linuxPackages;
18 };
19
20 testScript =
21 ''
22 assert "Linux" in machine.succeed("uname -s")
23 assert "${linuxPackages.kernel.modDirVersion}" in machine.succeed("uname -a")
24 '';
25 }) args);
26 kernels = (removeAttrs pkgs.linuxKernel.vanillaPackages ["__attrsFailEvaluation"]) // {
27 inherit (pkgs.linuxKernel.packages)
28 linux_4_19_hardened
29 linux_5_4_hardened
30 linux_5_10_hardened
31 linux_5_15_hardened
32 linux_6_1_hardened
33 linux_6_6_hardened
34 linux_6_8_hardened
35 linux_6_9_hardened
36 linux_rt_5_4
37 linux_rt_5_10
38 linux_rt_5_15
39 linux_rt_6_1
40 linux_libre
41
42 linux_testing;
43 };
44
45in mapAttrs (_: lP: testsForLinuxPackages lP) kernels // {
46 passthru = {
47 inherit testsForLinuxPackages;
48
49 testsForKernel = kernel: testsForLinuxPackages (pkgs.linuxPackagesFor kernel);
50 };
51}