mirror of
https://github.com/vagrant-libvirt/vagrant-libvirt.git
synced 2025-02-25 18:55:27 -06:00
Reduce start domain unnecessary domain redefines (#1178)
Various checks in the start domain action were accidentally causing a redefine right after initial create. Update to provide debug output when the domain needs to be changed to allow capture of the redefines occurring in the future and to make it easy for the tests to pick up where the redefine was triggered by setting an expectation on the log output. Include a small fix to avoid running strip on what might be a nil object returned for elements without any text attributes. Fix a bug where changes to tpm settings made to the config after an initial domain creation where there was previously no tpm defined, would be ignored. Adds a logger double and updates other tests that trigger log calls. should fix #1176
This commit is contained in:
@@ -7,6 +7,7 @@ shared_context 'libvirt' do
|
||||
let(:id) { 'dummy-vagrant_dummy' }
|
||||
let(:connection) { double('connection') }
|
||||
let(:domain) { double('domain') }
|
||||
let(:logger) { double('logger') }
|
||||
|
||||
def connection_result(options = {})
|
||||
result = options.fetch(:result, nil)
|
||||
@@ -26,5 +27,6 @@ shared_context 'libvirt' do
|
||||
allow(domain).to receive(:mac).and_return('9C:D5:53:F1:5A:E7')
|
||||
|
||||
allow(machine).to receive(:id).and_return(id)
|
||||
allow(Log4r::Logger).to receive(:new).and_return(logger)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user