diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2010-05-21 14:31:05 +0000 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2010-05-21 14:31:05 +0000 |
commit | dd813117147899b6aac82f82766a1a44559319db (patch) | |
tree | 375719265fee3e4aedbf9ae2ac14461bdf2f1d59 /lib | |
parent | fa183e54723e62f015813b01f848e855297d1538 (diff) | |
download | nixlib-dd813117147899b6aac82f82766a1a44559319db.tar nixlib-dd813117147899b6aac82f82766a1a44559319db.tar.gz nixlib-dd813117147899b6aac82f82766a1a44559319db.tar.bz2 nixlib-dd813117147899b6aac82f82766a1a44559319db.tar.lz nixlib-dd813117147899b6aac82f82766a1a44559319db.tar.xz nixlib-dd813117147899b6aac82f82766a1a44559319db.tar.zst nixlib-dd813117147899b6aac82f82766a1a44559319db.zip |
* Optionally pass the computed `nodes' to the test script as a
function argument, so that the test script can refer to computed values such as the assigned IP addresses of the virtual machines. svn path=/nixos/trunk/; revision=21939
Diffstat (limited to 'lib')
-rw-r--r-- | lib/build-vms.nix | 1 | ||||
-rw-r--r-- | lib/testing.nix | 18 |
2 files changed, 11 insertions, 8 deletions
diff --git a/lib/build-vms.nix b/lib/build-vms.nix index a84f55435c8d..a32e14489398 100644 --- a/lib/build-vms.nix +++ b/lib/build-vms.nix @@ -45,6 +45,7 @@ rec { EOF chmod +x $out/bin/run-vms ''; # */ + passthru = { nodes = nodes_; }; }; diff --git a/lib/testing.nix b/lib/testing.nix index 3a33ca69f08a..f2cc29a33ebc 100644 --- a/lib/testing.nix +++ b/lib/testing.nix @@ -95,17 +95,19 @@ rec { if t ? machine then { machine = t.machine; } else { }; vms = buildVirtualNetwork { inherit nodes; }; - test = runTests vms t.testScript; + test = runTests vms + # Call the test script with the computed nodes. + (if builtins.isFunction t.testScript then t.testScript { inherit (vms) nodes; } else t.testScript); report = makeReport test; }; - runInMachine = { - drv - , machine - , preBuild ? "" - , postBuild ? "" - , ... - }: + runInMachine = + { drv + , machine + , preBuild ? "" + , postBuild ? "" + , ... + }: let vms = buildVirtualNetwork { nodes = { client = machine; } ; }; |