3
0
Fork 0
forked from mirrors/nixpkgs

Only allow test names of up to 50 characters

This commit is contained in:
Michael Fellinger 2018-02-19 12:17:13 +01:00 committed by Tuomas Tynkkynen
parent d351cd9f69
commit 0d988d6735

View file

@ -78,7 +78,15 @@ rec {
} @ t:
let
testDriverName = "nixos-test-driver-${name}";
maxTestNameLen = 50;
testNameLen = builtins.stringLength name;
testDriverName = with builtins;
if testNameLen > maxTestNameLen then
abort ("The name of the test '${name}' must not be longer than ${toString maxTestNameLen} " +
"it's currently ${toString testNameLen} characters long.")
else
"nixos-test-driver-${name}";
nodes = buildVirtualNetwork (
t.nodes or (if t ? machine then { machine = t.machine; } else { }));