starting vm test was handing, fixed and moved sleep ping loop to after initial check

This commit is contained in:
John Bender 2010-02-09 11:10:50 -08:00
parent dccfeafa2e
commit 8c2068565b
2 changed files with 3 additions and 1 deletions

View File

@ -174,13 +174,14 @@ error
logger.info "Waiting for VM to boot..."
Hobo.config[:ssh][:max_tries].to_i.times do |i|
sleep 5 unless ENV['HOBO_ENV'] == 'test'
logger.info "Trying to connect (attempt ##{i+1} of #{Hobo.config[:ssh][:max_tries]})..."
if Hobo::SSH.up?
logger.info "VM booted and ready for use!"
return true
end
sleep 5 unless ENV['HOBO_ENV'] == 'test'
end
logger.info "Failed to connect to VM! Failed to boot?"

View File

@ -113,6 +113,7 @@ class VMTest < Test::Unit::TestCase
should "start the VM in headless mode" do
@mock_vm.expects(:start).with(:headless, true).once
Hobo::SSH.expects(:up?).once.returns(true)
@vm.start
end