nixpkgs/nixos/tests/wireguard/default.nix
sternenseemann 891a1f78e8 nixos/tests/wireguard: tie kernel version to test to default
When wireguard began being tested on multiple kernel versions, the
current default version at the time was hard coded:
41bd6d2614.

We should update this and prevent it from becoming stale ever again by
computing the default value.
2024-08-31 16:09:11 +02:00

29 lines
907 B
Nix

{ system ? builtins.currentSystem
, config ? { }
, pkgs ? import ../../.. { inherit system config; }
# Test current default (LTS) and latest kernel
, kernelVersionsToTest ? [ (pkgs.lib.versions.majorMinor pkgs.linuxPackages.kernel.version) "latest" ]
}:
with pkgs.lib;
let
tests = let callTest = p: args: import p ({ inherit system pkgs; } // args); in {
basic = callTest ./basic.nix;
namespaces = callTest ./namespaces.nix;
wg-quick = callTest ./wg-quick.nix;
wg-quick-nftables = args: callTest ./wg-quick.nix ({ nftables = true; } // args);
generated = callTest ./generated.nix;
};
in
listToAttrs (
flip concatMap kernelVersionsToTest (version:
let
v' = replaceStrings [ "." ] [ "_" ] version;
in
flip mapAttrsToList tests (name: test:
nameValuePair "wireguard-${name}-linux-${v'}" (test { kernelPackages = pkgs."linuxPackages_${v'}"; })
)
)
)