Revision f71bd5c6
Added by Ivan Necas about 8 years ago
test/unit/orchestration/dhcp_test.rb | ||
---|---|---|
assert h.queue.items.select {|x| x.action.last == :del_dhcp }.empty?
|
||
end
|
||
|
||
test "queue_dhcp doesn't fail when mac address is blank but provided by compute resource" do
|
||
cr = FactoryGirl.build(:libvirt_cr)
|
||
cr.stubs(:provided_attributes).returns({:mac => :mac})
|
||
host = FactoryGirl.build(:host, :with_dhcp_orchestration, :compute_resource => cr)
|
||
interface = host.interfaces.first
|
||
interface.mac = nil
|
||
interface.stubs(:dhcp? => true, :overwrite? => true)
|
||
|
||
assert interface.send(:queue_dhcp)
|
||
end
|
||
|
||
test "new host should create a BMC dhcp reservation" do
|
||
h = FactoryGirl.build(:host, :with_dhcp_orchestration, :name => 'dummy-123')
|
||
assert h.new_record?
|
Also available in: Unified diff
Fixes #5859 - don't rely on a mac address being present when overriding the conflicts
We tried to initiate the `dhcp_record` for checking if conflicts were
there. The problem was the mac address was not available at that stage
when using the compute resources. It also turns out there is no need
to initiate the dhcp_record at this stage, as we do that again while
actually removing the conflicts (and if no conflicts are there,
nothing happens anyway).
(cherry picked from commit c2c016425c4d27f560d5f9c18aec480666d51db3)