mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Handle VM not accessible during reboot (#1367)
To support commands requesting a reboot of a VM after execution, the query of ssh_info needs to avoid triggering an error when the IP address is not yet retrievable as this indicates the VM would not be reachable. Wrap the returning of the state in the driver to distinguish between the following states: - :running - indicates the machine is available - :inaccessible - the machine is running but not yet available to connect This is based on the behaviour from the virtualbox provider. Includes some rudimentary tests to exercise the driver state code. Closes: #1366
This commit is contained in:
@@ -12,14 +12,18 @@ describe VagrantPlugins::ProviderLibvirt::Action::DestroyDomain do
|
||||
include_context 'unit'
|
||||
include_context 'libvirt'
|
||||
|
||||
let(:driver) { double('driver') }
|
||||
let(:libvirt_domain) { double('libvirt_domain') }
|
||||
let(:libvirt_client) { double('libvirt_client') }
|
||||
let(:servers) { double('servers') }
|
||||
|
||||
before do
|
||||
allow(machine.provider).to receive('driver').and_return(driver)
|
||||
allow(driver).to receive(:connection).and_return(connection)
|
||||
end
|
||||
|
||||
describe '#call' do
|
||||
before do
|
||||
allow_any_instance_of(VagrantPlugins::ProviderLibvirt::Driver)
|
||||
.to receive(:connection).and_return(connection)
|
||||
allow(connection).to receive(:client).and_return(libvirt_client)
|
||||
allow(libvirt_client).to receive(:lookup_domain_by_uuid)
|
||||
.and_return(libvirt_domain)
|
||||
|
||||
Reference in New Issue
Block a user