Add reboot output to guest capability
This commit is contained in:
parent
dfe9762210
commit
ade5370db3
|
@ -21,6 +21,8 @@ module VagrantPlugins
|
||||||
@logger.debug("A reboot is already in progress")
|
@logger.debug("A reboot is already in progress")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
machine.ui.info(I18n.t("vagrant.guests.capabilities.rebooting"))
|
||||||
|
|
||||||
@logger.debug("Waiting for machine to finish rebooting")
|
@logger.debug("Waiting for machine to finish rebooting")
|
||||||
|
|
||||||
wait_remaining = MAX_REBOOT_RETRY_DURATION
|
wait_remaining = MAX_REBOOT_RETRY_DURATION
|
||||||
|
|
|
@ -1922,6 +1922,14 @@ en:
|
||||||
path of the shared folder must be located on a file system with
|
path of the shared folder must be located on a file system with
|
||||||
DrvFs type. Host path: %{path}
|
DrvFs type. Host path: %{path}
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
# Translations for guests
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
guests:
|
||||||
|
capabilities:
|
||||||
|
rebooting: |-
|
||||||
|
Waiting for machine to reboot...
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
# Translations for commands. e.g. `vagrant x`
|
# Translations for commands. e.g. `vagrant x`
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
|
@ -8,9 +8,10 @@ describe "VagrantPlugins::GuestWindows::Cap::Reboot" do
|
||||||
end
|
end
|
||||||
let(:vm) { double("vm") }
|
let(:vm) { double("vm") }
|
||||||
let(:config) { double("config") }
|
let(:config) { double("config") }
|
||||||
let(:machine) { double("machine") }
|
let(:machine) { double("machine", ui: ui) }
|
||||||
let(:guest) { double("guest") }
|
let(:guest) { double("guest") }
|
||||||
let(:communicator) { double("communicator") }
|
let(:communicator) { double("communicator") }
|
||||||
|
let(:ui) { double("ui") }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
allow(machine).to receive(:communicate).and_return(communicator)
|
allow(machine).to receive(:communicate).and_return(communicator)
|
||||||
|
@ -18,6 +19,7 @@ describe "VagrantPlugins::GuestWindows::Cap::Reboot" do
|
||||||
allow(machine.guest).to receive(:ready?).and_return(true)
|
allow(machine.guest).to receive(:ready?).and_return(true)
|
||||||
allow(machine).to receive(:config).and_return(config)
|
allow(machine).to receive(:config).and_return(config)
|
||||||
allow(config).to receive(:vm).and_return(vm)
|
allow(config).to receive(:vm).and_return(vm)
|
||||||
|
allow(ui).to receive(:info)
|
||||||
end
|
end
|
||||||
|
|
||||||
describe ".reboot" do
|
describe ".reboot" do
|
||||||
|
@ -34,6 +36,20 @@ describe "VagrantPlugins::GuestWindows::Cap::Reboot" do
|
||||||
|
|
||||||
described_class.reboot(machine)
|
described_class.reboot(machine)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "user output" do
|
||||||
|
before do
|
||||||
|
allow(communicator).to receive(:execute)
|
||||||
|
allow(described_class).to receive(:wait_for_reboot)
|
||||||
|
end
|
||||||
|
|
||||||
|
after { described_class.reboot(machine) }
|
||||||
|
|
||||||
|
it "sends message to user that guest is rebooting" do
|
||||||
|
expect(communicator).to receive(:test).and_return(true)
|
||||||
|
expect(ui).to receive(:info)
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "winrm communicator" do
|
describe "winrm communicator" do
|
||||||
|
|
Loading…
Reference in New Issue