Project

General

Profile

« Previous | Next » 

Revision 6a3b4abc

Added by Dominic Cleal over 7 years ago

fixes #18176 - replace clear_association_cache with reload

Reload is still necessary in Rails 5 as interfaces association will be
cached. The BMC test change is necessary to reload smart proxies
associated to the subnet after their features were altered - previously
clearing the entire subnet cache from `known_ips` also removed cached
smart proxies with outdated feature lists.

View differences:

test/models/subnet/ipv6_test.rb
assert_equal 4, subnet.known_ips.size
end
test "#known_ips returns host/interface IPs after creation" do
subnet = FactoryGirl.create(:subnet_ipv6, :name => 'my_subnet', :network => '2001:db8::', :dns_primary => '2001:db8::1', :gateway => '2001:db8::2', :ipam => IPAM::MODES[:db])
refute_includes subnet.known_ips, '2001:db8::3'
refute_includes subnet.known_ips, '2001:db8::4'
host = FactoryGirl.create(:host, :subnet6 => subnet, :ip6 => '2001:db8::3')
Nic::Managed.create :mac => "00:00:01:10:00:00", :host => host, :subnet6 => subnet, :name => "", :ip6 => '2001:db8::4'
assert_includes subnet.known_ips, '2001:db8::3'
assert_includes subnet.known_ips, '2001:db8::4'
end
private
def get_ip(subnet, i = 1)

Also available in: Unified diff