Project

General

Profile

« Previous | Next » 

Revision 9d56081f

Added by Timo Goebel almost 8 years ago

fixes #14664 - support IPv6 in Nic, Hosts and Hostgroups models

View differences:

test/unit/subnet/ipv6_test.rb
refute s.valid?
end
test "#known_ips includes all host and interfaces IPs assigned to this subnet" 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])
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::1'
assert_includes subnet.known_ips, '2001:db8::2'
assert_includes subnet.known_ips, '2001:db8::3'
assert_includes subnet.known_ips, '2001:db8::4'
assert_equal 4, subnet.known_ips.size
end
private
def get_ip(subnet, i = 1)

Also available in: Unified diff