mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 01:43:15 +00:00
27 lines
1005 B
Nix
27 lines
1005 B
Nix
|
{ system ? builtins.currentSystem
|
||
|
, config ? { }
|
||
|
, pkgs ? import ../../.. { inherit system config; }
|
||
|
, lib ? pkgs.lib
|
||
|
, kernelVersionsToTest ? [ "4.19" "5.4" "5.10" "5.15" "latest" ]
|
||
|
}:
|
||
|
|
||
|
let
|
||
|
tests = let callTest = p: lib.flip (import p) { inherit system pkgs; }; in {
|
||
|
thinpool = { test = callTest ./thinpool.nix; kernelFilter = lib.id; };
|
||
|
# we would like to test all versions, but the kernel module currently does not compile against the other versions
|
||
|
vdo = { test = callTest ./vdo.nix; kernelFilter = lib.filter (v: v == "5.15"); };
|
||
|
};
|
||
|
in
|
||
|
lib.listToAttrs (
|
||
|
lib.filter (x: x.value != {}) (
|
||
|
lib.flip lib.concatMap kernelVersionsToTest (version:
|
||
|
let
|
||
|
v' = lib.replaceStrings [ "." ] [ "_" ] version;
|
||
|
in
|
||
|
lib.flip lib.mapAttrsToList tests (name: t:
|
||
|
lib.nameValuePair "lvm-${name}-linux-${v'}" (lib.optionalAttrs (builtins.elem version (t.kernelFilter kernelVersionsToTest)) (t.test { kernelPackages = pkgs."linuxPackages_${v'}"; }))
|
||
|
)
|
||
|
)
|
||
|
)
|
||
|
)
|