Merge "Reorder classless static route (RFC3442) records"
This commit is contained in:
commit
c8047fb747
@ -1021,7 +1021,7 @@ class Dnsmasq(DhcpLocalProcess):
|
||||
if (s.ip_version == 4 and
|
||||
s.cidr != subnet.cidr and
|
||||
sub_segment_id == segment_id):
|
||||
host_routes.append("%s,0.0.0.0" % s.cidr)
|
||||
host_routes.insert(0, "%s,0.0.0.0" % s.cidr)
|
||||
|
||||
if host_routes:
|
||||
if gateway:
|
||||
|
@ -1603,11 +1603,11 @@ class TestDnsmasq(TestBase):
|
||||
def test_output_opts_file_single_dhcp(self):
|
||||
expected = (
|
||||
'tag:tag0,option:dns-server,8.8.8.8\n'
|
||||
'tag:tag0,option:classless-static-route,20.0.0.1/24,20.0.0.1,'
|
||||
'169.254.169.254/32,192.168.0.1,'
|
||||
'192.168.1.0/24,0.0.0.0,0.0.0.0/0,192.168.0.1\n'
|
||||
'tag:tag0,249,20.0.0.1/24,20.0.0.1,'
|
||||
'169.254.169.254/32,192.168.0.1,192.168.1.0/24,0.0.0.0,'
|
||||
'tag:tag0,option:classless-static-route,192.168.1.0/24,0.0.0.0,'
|
||||
'20.0.0.1/24,20.0.0.1,169.254.169.254/32,192.168.0.1,'
|
||||
'0.0.0.0/0,192.168.0.1\n'
|
||||
'tag:tag0,249,192.168.1.0/24,0.0.0.0,'
|
||||
'20.0.0.1/24,20.0.0.1,169.254.169.254/32,192.168.0.1,'
|
||||
'0.0.0.0/0,192.168.0.1\n'
|
||||
'tag:tag0,option:router,192.168.0.1').lstrip()
|
||||
|
||||
@ -1628,19 +1628,18 @@ class TestDnsmasq(TestBase):
|
||||
def test_output_opts_file_dual_dhcp_rfc3442(self):
|
||||
expected = (
|
||||
'tag:tag0,option:dns-server,8.8.8.8\n'
|
||||
'tag:tag0,option:classless-static-route,20.0.0.1/24,20.0.0.1,'
|
||||
'169.254.169.254/32,192.168.0.1,'
|
||||
'192.168.1.0/24,0.0.0.0,0.0.0.0/0,192.168.0.1\n'
|
||||
'tag:tag0,249,20.0.0.1/24,20.0.0.1,'
|
||||
'169.254.169.254/32,192.168.0.1,192.168.1.0/24,0.0.0.0,'
|
||||
'tag:tag0,option:classless-static-route,192.168.1.0/24,0.0.0.0,'
|
||||
'20.0.0.1/24,20.0.0.1,169.254.169.254/32,192.168.0.1,'
|
||||
'0.0.0.0/0,192.168.0.1\n'
|
||||
'tag:tag0,249,192.168.1.0/24,0.0.0.0,'
|
||||
'20.0.0.1/24,20.0.0.1,169.254.169.254/32,192.168.0.1,'
|
||||
'0.0.0.0/0,192.168.0.1\n'
|
||||
'tag:tag0,option:router,192.168.0.1\n'
|
||||
'tag:tag1,option:dns-server,8.8.8.8\n'
|
||||
'tag:tag1,option:classless-static-route,'
|
||||
'169.254.169.254/32,192.168.1.1,'
|
||||
'192.168.0.0/24,0.0.0.0,0.0.0.0/0,192.168.1.1\n'
|
||||
'tag:tag1,249,169.254.169.254/32,192.168.1.1,'
|
||||
'192.168.0.0/24,0.0.0.0,0.0.0.0/0,192.168.1.1\n'
|
||||
'tag:tag1,option:classless-static-route,192.168.0.0/24,0.0.0.0,'
|
||||
'169.254.169.254/32,192.168.1.1,0.0.0.0/0,192.168.1.1\n'
|
||||
'tag:tag1,249,192.168.0.0/24,0.0.0.0,'
|
||||
'169.254.169.254/32,192.168.1.1,0.0.0.0/0,192.168.1.1\n'
|
||||
'tag:tag1,option:router,192.168.1.1').lstrip()
|
||||
|
||||
self._test_output_opts_file(expected, FakeDualNetworkDualDHCP())
|
||||
@ -1666,19 +1665,18 @@ class TestDnsmasq(TestBase):
|
||||
def test_output_opts_file_dual_dhcp_rfc3442_one_on_link_subnet_route(self):
|
||||
expected = (
|
||||
'tag:tag0,option:dns-server,8.8.8.8\n'
|
||||
'tag:tag0,option:classless-static-route,20.0.0.1/24,20.0.0.1,'
|
||||
'169.254.169.254/32,192.168.0.1,'
|
||||
'192.168.1.0/24,0.0.0.0,0.0.0.0/0,192.168.0.1\n'
|
||||
'tag:tag0,249,20.0.0.1/24,20.0.0.1,'
|
||||
'169.254.169.254/32,192.168.0.1,192.168.1.0/24,0.0.0.0,'
|
||||
'tag:tag0,option:classless-static-route,192.168.1.0/24,0.0.0.0,'
|
||||
'20.0.0.1/24,20.0.0.1,169.254.169.254/32,192.168.0.1,'
|
||||
'0.0.0.0/0,192.168.0.1\n'
|
||||
'tag:tag0,249,192.168.1.0/24,0.0.0.0,'
|
||||
'20.0.0.1/24,20.0.0.1,169.254.169.254/32,192.168.0.1,'
|
||||
'0.0.0.0/0,192.168.0.1\n'
|
||||
'tag:tag0,option:router,192.168.0.1\n'
|
||||
'tag:tag1,option:dns-server,8.8.8.8\n'
|
||||
'tag:tag1,option:classless-static-route,'
|
||||
'169.254.169.254/32,192.168.1.1,'
|
||||
'192.168.0.0/24,0.0.0.0,0.0.0.0/0,192.168.1.1\n'
|
||||
'tag:tag1,249,169.254.169.254/32,192.168.1.1,'
|
||||
'192.168.0.0/24,0.0.0.0,0.0.0.0/0,192.168.1.1\n'
|
||||
'tag:tag1,option:classless-static-route,192.168.0.0/24,0.0.0.0,'
|
||||
'169.254.169.254/32,192.168.1.1,0.0.0.0/0,192.168.1.1\n'
|
||||
'tag:tag1,249,192.168.0.0/24,0.0.0.0,'
|
||||
'169.254.169.254/32,192.168.1.1,0.0.0.0/0,192.168.1.1\n'
|
||||
'tag:tag1,option:router,192.168.1.1\n'
|
||||
'tag:tag2,option:dns-server,8.8.8.8\n'
|
||||
'tag:tag2,option:classless-static-route,'
|
||||
@ -1793,11 +1791,11 @@ class TestDnsmasq(TestBase):
|
||||
def test_output_opts_file_pxe_3port_2net(self):
|
||||
expected = (
|
||||
'tag:tag0,option:dns-server,8.8.8.8\n'
|
||||
'tag:tag0,option:classless-static-route,20.0.0.1/24,20.0.0.1,'
|
||||
'169.254.169.254/32,192.168.0.1,'
|
||||
'192.168.1.0/24,0.0.0.0,0.0.0.0/0,192.168.0.1\n'
|
||||
'tag:tag0,249,20.0.0.1/24,20.0.0.1,'
|
||||
'169.254.169.254/32,192.168.0.1,192.168.1.0/24,0.0.0.0,'
|
||||
'tag:tag0,option:classless-static-route,192.168.1.0/24,0.0.0.0,'
|
||||
'20.0.0.1/24,20.0.0.1,169.254.169.254/32,192.168.0.1,'
|
||||
'0.0.0.0/0,192.168.0.1\n'
|
||||
'tag:tag0,249,192.168.1.0/24,0.0.0.0,'
|
||||
'20.0.0.1/24,20.0.0.1,169.254.169.254/32,192.168.0.1,'
|
||||
'0.0.0.0/0,192.168.0.1\n'
|
||||
'tag:tag0,option:router,192.168.0.1\n'
|
||||
'tag:eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee,'
|
||||
|
Loading…
Reference in New Issue
Block a user