diff options
author | Michael Fellinger <michael.fellinger@xing.com> | 2018-02-19 12:17:13 +0100 |
---|---|---|
committer | Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi> | 2018-02-20 16:36:16 +0200 |
commit | 0d988d6735e3afa37aba7e838bde0fd80fd34f49 (patch) | |
tree | 70371801496f7681a6bc375db4591e0f9c8846c7 /nixos/lib | |
parent | d351cd9f6959646d9b52abf014360b7a6e8c958d (diff) |
Only allow test names of up to 50 characters
Diffstat (limited to 'nixos/lib')
-rw-r--r-- | nixos/lib/testing.nix | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/nixos/lib/testing.nix b/nixos/lib/testing.nix index ddab23cce3937..05b4f752da400 100644 --- a/nixos/lib/testing.nix +++ b/nixos/lib/testing.nix @@ -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 { })); |