Merge "Use --bind-dynamic with dnsmasq instead of --bind-interfaces"
This commit is contained in:
commit
1134b2a44d
neutron
@ -354,14 +354,10 @@ class Dnsmasq(DhcpLocalProcess):
|
|||||||
'--dhcp-match=set:ipxe,175',
|
'--dhcp-match=set:ipxe,175',
|
||||||
'--dhcp-userclass=set:ipxe6,iPXE',
|
'--dhcp-userclass=set:ipxe6,iPXE',
|
||||||
'--local-service',
|
'--local-service',
|
||||||
|
'--bind-dynamic',
|
||||||
]
|
]
|
||||||
if self.device_manager.driver.bridged:
|
if not self.device_manager.driver.bridged:
|
||||||
cmd += [
|
cmd += [
|
||||||
'--bind-interfaces',
|
|
||||||
]
|
|
||||||
else:
|
|
||||||
cmd += [
|
|
||||||
'--bind-dynamic',
|
|
||||||
'--bridge-interface=%s,tap*' % self.interface_name,
|
'--bridge-interface=%s,tap*' % self.interface_name,
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -1260,7 +1260,8 @@ class TestDnsmasq(TestBase):
|
|||||||
def _test_spawn(self, extra_options, network=FakeDualNetwork(),
|
def _test_spawn(self, extra_options, network=FakeDualNetwork(),
|
||||||
max_leases=16777216, lease_duration=86400,
|
max_leases=16777216, lease_duration=86400,
|
||||||
has_static=True, no_resolv='--no-resolv',
|
has_static=True, no_resolv='--no-resolv',
|
||||||
has_stateless=True, dhcp_t1=0, dhcp_t2=0):
|
has_stateless=True, dhcp_t1=0, dhcp_t2=0,
|
||||||
|
bridged=True):
|
||||||
def mock_get_conf_file_name(kind):
|
def mock_get_conf_file_name(kind):
|
||||||
return '/dhcp/%s/%s' % (network.id, kind)
|
return '/dhcp/%s/%s' % (network.id, kind)
|
||||||
|
|
||||||
@ -1281,8 +1282,12 @@ class TestDnsmasq(TestBase):
|
|||||||
'--dhcp-match=set:ipxe,175',
|
'--dhcp-match=set:ipxe,175',
|
||||||
'--dhcp-userclass=set:ipxe6,iPXE',
|
'--dhcp-userclass=set:ipxe6,iPXE',
|
||||||
'--local-service',
|
'--local-service',
|
||||||
'--bind-interfaces',
|
'--bind-dynamic',
|
||||||
]
|
]
|
||||||
|
if not bridged:
|
||||||
|
expected += [
|
||||||
|
'--bridge-interface=tap0,tap*'
|
||||||
|
]
|
||||||
|
|
||||||
seconds = ''
|
seconds = ''
|
||||||
if lease_duration == -1:
|
if lease_duration == -1:
|
||||||
@ -1356,6 +1361,11 @@ class TestDnsmasq(TestBase):
|
|||||||
def test_spawn(self):
|
def test_spawn(self):
|
||||||
self._test_spawn(['--conf-file=', '--domain=openstacklocal'])
|
self._test_spawn(['--conf-file=', '--domain=openstacklocal'])
|
||||||
|
|
||||||
|
def test_spawn_not_bridged(self):
|
||||||
|
self.mock_mgr.return_value.driver.bridged = False
|
||||||
|
self._test_spawn(['--conf-file=', '--domain=openstacklocal'],
|
||||||
|
bridged=False)
|
||||||
|
|
||||||
def test_spawn_infinite_lease_duration(self):
|
def test_spawn_infinite_lease_duration(self):
|
||||||
self.conf.set_override('dhcp_lease_duration', -1)
|
self.conf.set_override('dhcp_lease_duration', -1)
|
||||||
self._test_spawn(['--conf-file=', '--domain=openstacklocal'],
|
self._test_spawn(['--conf-file=', '--domain=openstacklocal'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user