summary refs log tree commit diff
path: root/nixos/tests/wireguard/default.nix
blob: dedb321ff2ef9ce8c2b0b3bf897501c14db92c8a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{ system ? builtins.currentSystem
, config ? { }
, pkgs ? import ../../.. { inherit system config; }
, kernelVersionsToTest ? [ "5.4" "latest" ]
}:

with pkgs.lib;

let
  tests = let callTest = p: flip (import p) { inherit system pkgs; }; in {
    basic = callTest ./basic.nix;
    namespaces = callTest ./namespaces.nix;
    wg-quick = callTest ./wg-quick.nix;
    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'}"; })
    )
  )
)