support for nixos test names
This commit is contained in:
parent
71812277d3
commit
6a3e6164bd
@ -37,7 +37,7 @@ rec {
|
|||||||
# `driver' is the script that runs the network.
|
# `driver' is the script that runs the network.
|
||||||
runTests = driver:
|
runTests = driver:
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "vm-test-run";
|
name = "vm-test-run-${driver.testName}";
|
||||||
|
|
||||||
requiredSystemFeatures = [ "kvm" "nixos-test" ];
|
requiredSystemFeatures = [ "kvm" "nixos-test" ];
|
||||||
|
|
||||||
@ -68,9 +68,10 @@ rec {
|
|||||||
|
|
||||||
|
|
||||||
makeTest =
|
makeTest =
|
||||||
{ testScript, makeCoverageReport ? false, ... } @ t:
|
{ testScript, makeCoverageReport ? false, name ? "unnamed", ... } @ t:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
testDriverName = "nixos-test-driver-${name}";
|
||||||
|
|
||||||
nodes = buildVirtualNetwork (
|
nodes = buildVirtualNetwork (
|
||||||
t.nodes or (if t ? machine then { machine = t.machine; } else { }));
|
t.nodes or (if t ? machine then { machine = t.machine; } else { }));
|
||||||
@ -88,10 +89,11 @@ rec {
|
|||||||
# Generate onvenience wrappers for running the test driver
|
# Generate onvenience wrappers for running the test driver
|
||||||
# interactively with the specified network, and for starting the
|
# interactively with the specified network, and for starting the
|
||||||
# VMs from the command line.
|
# VMs from the command line.
|
||||||
driver = runCommand "nixos-test-driver"
|
driver = runCommand testDriverName
|
||||||
{ buildInputs = [ makeWrapper];
|
{ buildInputs = [ makeWrapper];
|
||||||
testScript = testScript';
|
testScript = testScript';
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
|
testName = name;
|
||||||
}
|
}
|
||||||
''
|
''
|
||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
|
Loading…
x
Reference in New Issue
Block a user