1 { system ? builtins.currentSystem
3 , pkgs ? import ../../.. { inherit system config; }
5 , kernelVersionsToTest ? [ "4.19" "5.4" "5.10" "5.15" "6.1" "latest" ]
8 # For quickly running a test, the nixosTests.lvm2.lvm-thinpool-linux-latest attribute is recommended
10 tests = let callTest = p: lib.flip (import p) { inherit system pkgs; }; in {
11 thinpool = { test = callTest ./thinpool.nix; kernelFilter = lib.id; };
12 # we would like to test all versions, but the kernel module currently does not compile against the other versions
13 vdo = { test = callTest ./vdo.nix; kernelFilter = lib.filter (v: v == "latest"); };
18 test = callTest ./systemd-stage-1.nix;
19 kernelFilter = lib.id;
22 thinpool-sd-stage-1 = {
23 test = callTest ./systemd-stage-1.nix;
24 kernelFilter = lib.id;
28 test = callTest ./systemd-stage-1.nix;
29 kernelFilter = lib.filter (v: v == "latest");
35 lib.filter (x: x.value != {}) (
36 lib.flip lib.concatMap kernelVersionsToTest (version:
38 v' = lib.replaceStrings [ "." ] [ "_" ] version;
39 mkXfsFlags = lib.optionalString (lib.versionOlder version "5.10") " -m bigtime=0 -m inobtcount=0 "
40 + lib.optionalString (lib.versionOlder version "5.19") " -i nrext64=0 ";
42 lib.flip lib.mapAttrsToList tests (name: t:
43 lib.nameValuePair "lvm-${name}-linux-${v'}" (lib.optionalAttrs (builtins.elem version (t.kernelFilter kernelVersionsToTest)) (t.test ({
44 kernelPackages = pkgs."linuxPackages_${v'}";
46 } // builtins.removeAttrs t [ "test" "kernelFilter" ])))