Fix halt issues and acceptance test associated with it

This commit is contained in:
Mitchell Hashimoto 2011-12-22 13:38:30 -08:00
parent 36632c4bb7
commit dfeafa3776
6 changed files with 9 additions and 9 deletions

View File

@ -11,7 +11,7 @@ module Vagrant
if env[:vm].state == :running
env[:vm].guest.halt if !env["force"]
if env[:vm].state != :poweredoff
if env[:vm].state != :poweroff
env[:ui].info I18n.t("vagrant.actions.vm.halt.force")
env[:vm].driver.halt
end

View File

@ -33,7 +33,7 @@ module Vagrant
# occur within a reasonable amount of time (15 seconds by default),
# then simply return and allow Vagrant to kill the machine.
count = 0
while vm.state != :powered_off
while vm.state != :poweroff
count += 1
return if count >= vm.config.freebsd.halt_timeout

View File

@ -31,7 +31,7 @@ module Vagrant
# occur within a reasonable amount of time (15 seconds by default),
# then simply return and allow Vagrant to kill the machine.
count = 0
while vm.state != :powered_off
while vm.state != :poweroff
count += 1
return if count >= vm.config.linux.halt_timeout

View File

@ -68,7 +68,7 @@ module Vagrant
# then simply return and allow Vagrant to kill the machine.
count = 0
last_error = nil
while vm.state != :powered_off
while vm.state != :poweroff
begin
ssh.exec!("#{vm.config.solaris.suexec_cmd} /usr/sbin/poweroff")
rescue IOError => e

View File

@ -23,10 +23,10 @@ if Acceptance::VirtualBox.find_vboxsvc
end
# Enable logging if requested
if ENV["ACCEPTANCE_LOGGING"]
if ENV["ACCEPTANCE_LOG"]
logger = Log4r::Logger.new("acceptance")
logger.outputters = Log4r::Outputter.stdout
logger.level = Log4r.const_get(ENV["ACCEPTANCE_LOGGING"].upcase)
logger.level = Log4r.const_get(ENV["ACCEPTANCE_LOG"].upcase)
logger = nil
end

View File

@ -28,7 +28,7 @@ describe "vagrant halt" do
# Assert that the VM is no longer running
result = assert_execute("vagrant", "status")
result.stdout.should match_output(:status, "default", "powered off")
result.stdout.should match_output(:status, "default", "poweroff")
end
it "is able to force halt a running virtual machine" do
@ -44,7 +44,7 @@ describe "vagrant halt" do
# Assert that the VM is no longer running
result = assert_execute("vagrant", "status")
result.stdout.should match_output(:status, "default", "powered off")
result.stdout.should match_output(:status, "default", "poweroff")
end
it "is able to come back up after the machine has been halted" do
@ -57,7 +57,7 @@ describe "vagrant halt" do
# Assert that the VM is no longer running
result = assert_execute("vagrant", "status")
result.stdout.should match_output(:status, "default", "powered off")
result.stdout.should match_output(:status, "default", "poweroff")
assert_execute("vagrant", "up")