3
0
Fork 0
forked from mirrors/nixpkgs

nixos/tests/networking: Expose subtests via attrs

So far the networking test expression only generated a single test
depending on the passed "test" attribute. This makes it difficult to
autodiscover the subtests with our shiny new callSubTests function.

This change essentially doesn't change the behaviour of the subtests but
rather exposes them as an attribute set instead of relying on a
particular input argument.

The useNetworkd argument still exists however.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @wkennington
This commit is contained in:
aszlig 2016-02-29 20:06:55 +01:00
parent b3337edd0b
commit 2f2536b935
No known key found for this signature in database
GPG key ID: D0EBD0EC8C2DC961

View file

@ -1,5 +1,9 @@
import ./make-test.nix ({ pkgs, networkd, test, ... }:
let
{ system ? builtins.currentSystem, networkd }:
with import ../lib/testing.nix { inherit system; };
with pkgs.lib;
let
router = { config, pkgs, ... }:
with pkgs.lib;
let
@ -30,6 +34,7 @@ import ./make-test.nix ({ pkgs, networkd, test, ... }:
'');
};
};
testCases = {
loopback = {
name = "Loopback";
@ -397,10 +402,10 @@ import ./make-test.nix ({ pkgs, networkd, test, ... }:
'';
};
};
case = testCases.${test};
in case // {
name = "${case.name}-Networking-${if networkd then "Networkd" else "Scripted"}";
in mapAttrs (const (attrs: makeTest (attrs // {
name = "${attrs.name}-Networking-${if networkd then "Networkd" else "Scripted"}";
meta = with pkgs.stdenv.lib.maintainers; {
maintainers = [ wkennington ];
};
})
}))) testCases