nixos/tests/vbox: Make shutdown less noisy

Using waitUntilSucceeds for testing whether the shutdown signalling
files have vanished is quite noisy because it prints two lines for every
try. This is now fixed with a while loop on the guest VM which does the
same check but with only one output for the command that's executed and
another one when the conditions are met.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2016-09-13 14:52:49 +02:00
parent e19aa3819e
commit 562c7f56f0
No known key found for this signature in database
GPG key ID: 1DE8E48E57DB5436

View file

@ -273,9 +273,12 @@ let
sub shutdownVM_${name} {
$machine->succeed(ru "touch ${sharePath}/shutdown");
$machine->waitUntilSucceeds(
"test ! -e ${sharePath}/shutdown ".
" -a ! -e ${sharePath}/boot-done"
$machine->execute(
'set -e; i=0; '.
'while test -e ${sharePath}/shutdown '.
' -o -e ${sharePath}/boot-done; do '.
'sleep 1; i=$(($i + 1)); [ $i -le 3600 ]; '.
'done'
);
waitForShutdown_${name};
}