Merge "Add unit tests and release note for dns_publish_fixed_ip"

This commit is contained in:
Zuul 2020-03-24 21:24:52 +00:00 committed by Gerrit Code Review
commit 2c8d705a24
2 changed files with 46 additions and 0 deletions

View File

@ -460,6 +460,44 @@ class TestCreateSubnet(TestSubnet):
self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data)
def _test_create_with_dns(self, publish_dns=True):
arglist = [
"--subnet-range", self._subnet.cidr,
"--network", self._subnet.network_id,
self._subnet.name,
]
if publish_dns:
arglist += ['--dns-publish-fixed-ip']
else:
arglist += ['--no-dns-publish-fixed-ip']
verifylist = [
('name', self._subnet.name),
('subnet_range', self._subnet.cidr),
('network', self._subnet.network_id),
('ip_version', self._subnet.ip_version),
('gateway', 'auto'),
]
verifylist.append(('dns_publish_fixed_ip', publish_dns))
parsed_args = self.check_parser(self.cmd, arglist, verifylist)
columns, data = (self.cmd.take_action(parsed_args))
self.network.create_subnet.assert_called_once_with(
cidr=self._subnet.cidr,
ip_version=self._subnet.ip_version,
name=self._subnet.name,
network_id=self._subnet.network_id,
dns_publish_fixed_ip=publish_dns,
)
self.assertEqual(self.columns, columns)
self.assertItemEqual(self.data, data)
def test_create_with_dns(self):
self._test_create_with_dns(publish_dns=True)
def test_create_with_no_dns(self):
self._test_create_with_dns(publish_dns=False)
def _test_create_with_tag(self, add_tags=True):
arglist = [
"--subnet-range", self._subnet.cidr,

View File

@ -0,0 +1,8 @@
---
features:
- |
Add ``--dns-publish-fixed-ip`` and ``--no-dns-publish-fixed-ip``
options to ``create subnet`` and ``set subnet`` commands to
control the publishing of fixed IPs in DNS when the
``subnet_dns_publish_fixed_ip`` Neutron extension is enabled.
[Bug `1784879 <https://bugs.launchpad.net/neutron/+bug/1784879>`_]