Fix halt issues and acceptance test associated with it
This commit is contained in:
parent
36632c4bb7
commit
dfeafa3776
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
||||
|
|
Loading…
Reference in New Issue