diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-06-22 14:31:07 -0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-06-22 14:31:07 -0400 |
commit | 82019c01bb638b0ce243f14ed74a62c8e5312140 (patch) | |
tree | 285f8948b36e8bfd59e1b82e79e7b217ae7e0621 /lib | |
parent | 1da7cea2230cfef072a67cc34250818a86d1c0be (diff) | |
download | nixlib-82019c01bb638b0ce243f14ed74a62c8e5312140.tar nixlib-82019c01bb638b0ce243f14ed74a62c8e5312140.tar.gz nixlib-82019c01bb638b0ce243f14ed74a62c8e5312140.tar.bz2 nixlib-82019c01bb638b0ce243f14ed74a62c8e5312140.tar.lz nixlib-82019c01bb638b0ce243f14ed74a62c8e5312140.tar.xz nixlib-82019c01bb638b0ce243f14ed74a62c8e5312140.tar.zst nixlib-82019c01bb638b0ce243f14ed74a62c8e5312140.zip |
Test driver: exit when all VMs have exited rather than sleeping forever
Diffstat (limited to 'lib')
-rw-r--r-- | lib/test-driver/test-driver.pl | 8 | ||||
-rw-r--r-- | lib/testing.nix | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/lib/test-driver/test-driver.pl b/lib/test-driver/test-driver.pl index 0fdcf97af679..43f74cf404bb 100644 --- a/lib/test-driver/test-driver.pl +++ b/lib/test-driver/test-driver.pl @@ -68,6 +68,14 @@ sub startAll { } +# Wait until all VMs have terminated. +sub joinAll { + $log->nest("waiting for all VMs to finish", sub { + $_->waitForShutdown foreach values %vms; + }); +} + + # In interactive tests, this allows the non-interactive test script to # be executed conveniently. sub testScript { diff --git a/lib/testing.nix b/lib/testing.nix index 704ee4025a50..6a39df8c865d 100644 --- a/lib/testing.nix +++ b/lib/testing.nix @@ -157,7 +157,7 @@ rec { ln -s ${testDriver}/bin/nixos-test-driver $out/bin/nixos-run-vms wrapProgram $out/bin/nixos-run-vms \ --add-flags "$vms" \ - --set tests '"startAll; sleep 1e9;"' \ + --set tests '"startAll; joinAll;"' \ --set VLANS '"${toString vlans}"' ''; # " |