puppet-ironic/spec/functions/ipv6_normalize_dnsmasq_ip_subnets_spec.rb
Harald Jensås 15eedd0c4c Fix Inspector dnsmasq config for IPv6
Extend and re-name the function ipv6_netmask_to_prefix() to
ipv6_normalize_dnsmasq_ip_subnets(). It now changes the netmask
to prefix and removes the 'gateway' if it is an IPv6 subnet.

On IPv6 router info should be provided in router advertisements.
There was a draft to add support in DHCPv6, but it was never
completed.
https://datatracker.ietf.org/doc/draft-ietf-mif-dhcpv6-route-option/

Also:
  Add match for userclass iPXE and set option6:bootfile-url

Closes-Bug: #1844573
Change-Id: I47d88519acd18630e0d5682d93f1088771ec03a1
2019-09-27 20:20:13 +02:00

13 lines
914 B
Ruby

require 'spec_helper'
describe 'ipv6_normalize_dnsmasq_ip_subnets' do
it { should run.with_params([{'ip_range' => '192.168.0.100,192.168.0.120'}]).and_return([{'ip_range' => '192.168.0.100,192.168.0.120'}])}
it { should run.with_params([{'netmask' => '255.255.255.0',}]).and_return([{'netmask' => '255.255.255.0'}])}
it { should run.with_params([{'netmask' => 'ffff:ffff:ffff:ffff::'}]).and_return([{'netmask' => 64}])}
it { should run.with_params([{'netmask' => '64'}]).and_return([{'netmask' => '64'}])}
it { should run.with_params([{'netmask' => 64}]).and_return([{'netmask' => 64}])}
it { should run.with_params([{'gateway' => '192.168.0.1'}]).and_return([{'gateway' => '192.168.0.1'}])}
it { should run.with_params([{'gateway' => 'fd00::1'}]).and_return([{}])}
it { should run.with_params([{'netmask' => 'ffff:ffff:ffff:ffff::', 'gateway' => 'fd00::1'}]).and_return([{'netmask' => 64}])}
end