Add API test for port dns_domain

This patchset adds a Tempest API test for the port dns_domain attribute.

It also enables the dns-domain-ports extension for testing, which is a
super-set of the dns extension.

Change-Id: I5c1da61a8a49c190aad549713da646a3abb8ccb1
(cherry picked from commit 39a9e09716)
This commit is contained in:
Miguel Lavalle 2017-08-06 17:38:54 -05:00 committed by Ihar Hrachyshka
parent b6e856919f
commit 9503b9f5e3
2 changed files with 25 additions and 1 deletions

View File

@ -1,5 +1,5 @@
function configure_dns_extension {
neutron_ml2_extension_driver_add "dns"
neutron_ml2_extension_driver_add "dns_domain_ports"
}
function post_config_dns_extension {
iniset $NEUTRON_CONF DEFAULT dns_domain openstackgate.local

View File

@ -91,6 +91,30 @@ class PortsTestJSON(base.BaseNetworkTest):
self.assertFalse(port_body['port']['dns_name'])
self._confirm_dns_assignment(port_body['port'])
@decorators.idempotent_id('dfe8cc79-18d9-4ae8-acef-3ec6bb719aa7')
@test.requires_ext(extension="dns-domain-ports",
service="network")
def test_create_update_port_with_dns_domain(self):
self.create_subnet(self.network)
body = self.create_port(self.network, dns_name='d1',
dns_domain='test.org.')
self.assertEqual('d1', body['dns_name'])
self.assertEqual('test.org.', body['dns_domain'])
self._confirm_dns_assignment(body)
body = self.client.list_ports(id=body['id'])['ports'][0]
self._confirm_dns_assignment(body)
self.assertEqual('d1', body['dns_name'])
self.assertEqual('test.org.', body['dns_domain'])
body = self.client.update_port(body['id'],
dns_name='d2', dns_domain='d.org.')
self.assertEqual('d2', body['port']['dns_name'])
self.assertEqual('d.org.', body['dns_domain'])
self._confirm_dns_assignment(body['port'])
body = self.client.show_port(body['port']['id'])['port']
self.assertEqual('d2', body['dns_name'])
self.assertEqual('d.org.', body['dns_domain'])
self._confirm_dns_assignment(body)
@decorators.idempotent_id('c72c1c0c-2193-4aca-bbb4-b1442640c123')
def test_change_dhcp_flag_then_create_port(self):
s = self.create_subnet(self.network, enable_dhcp=False)