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:
parent
b3337edd0b
commit
2f2536b935
|
@ -1,5 +1,9 @@
|
||||||
import ./make-test.nix ({ pkgs, networkd, test, ... }:
|
{ system ? builtins.currentSystem, networkd }:
|
||||||
let
|
|
||||||
|
with import ../lib/testing.nix { inherit system; };
|
||||||
|
with pkgs.lib;
|
||||||
|
|
||||||
|
let
|
||||||
router = { config, pkgs, ... }:
|
router = { config, pkgs, ... }:
|
||||||
with pkgs.lib;
|
with pkgs.lib;
|
||||||
let
|
let
|
||||||
|
@ -30,6 +34,7 @@ import ./make-test.nix ({ pkgs, networkd, test, ... }:
|
||||||
'');
|
'');
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
testCases = {
|
testCases = {
|
||||||
loopback = {
|
loopback = {
|
||||||
name = "Loopback";
|
name = "Loopback";
|
||||||
|
@ -397,10 +402,10 @@ import ./make-test.nix ({ pkgs, networkd, test, ... }:
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
case = testCases.${test};
|
|
||||||
in case // {
|
in mapAttrs (const (attrs: makeTest (attrs // {
|
||||||
name = "${case.name}-Networking-${if networkd then "Networkd" else "Scripted"}";
|
name = "${attrs.name}-Networking-${if networkd then "Networkd" else "Scripted"}";
|
||||||
meta = with pkgs.stdenv.lib.maintainers; {
|
meta = with pkgs.stdenv.lib.maintainers; {
|
||||||
maintainers = [ wkennington ];
|
maintainers = [ wkennington ];
|
||||||
};
|
};
|
||||||
})
|
}))) testCases
|
||||||
|
|
Loading…
Reference in a new issue