From 562c7f56f0526c2353b99246370a3d17f40ec148 Mon Sep 17 00:00:00 2001 From: aszlig Date: Tue, 13 Sep 2016 14:52:49 +0200 Subject: [PATCH] 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 --- nixos/tests/virtualbox.nix | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nixos/tests/virtualbox.nix b/nixos/tests/virtualbox.nix index ab4d46ab7e1..c1205ca0c8a 100644 --- a/nixos/tests/virtualbox.nix +++ b/nixos/tests/virtualbox.nix @@ -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}; }