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
diff --git a/neutron/tests/tempest/api/test_ports.py b/neutron/tests/tempest/api/test_ports.py
index 8d8468c..acafa57 100644
--- a/neutron/tests/tempest/api/test_ports.py
+++ b/neutron/tests/tempest/api/test_ports.py
@@ -91,6 +91,30 @@
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)