From d54ae6c93661d90a2c4a62f56049d33446aacb0a Mon Sep 17 00:00:00 2001 From: Assaf Muller Date: Thu, 31 May 2018 11:38:00 -0400 Subject: [PATCH] Enhance scenario test to cover network dns_domain Co-Authored-By: Slawek Kaplonski Depends-On: I6120d504959631f084d63458f6e9dada0dc5cbdf Depends-On: https://review.openstack.org/615556 Change-Id: Iaef52f9c43498c1748da14cd5ce72635bd31892d --- neutron_tempest_plugin/scenario/base.py | 4 ++-- neutron_tempest_plugin/scenario/test_internal_dns.py | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/neutron_tempest_plugin/scenario/base.py b/neutron_tempest_plugin/scenario/base.py index a2c5c721..32c5db85 100644 --- a/neutron_tempest_plugin/scenario/base.py +++ b/neutron_tempest_plugin/scenario/base.py @@ -176,13 +176,13 @@ class BaseTempestTestCase(base_api.BaseNetworkTest): client.delete_interface(server_id, port_id=port_id) def setup_network_and_server( - self, router=None, server_name=None, **kwargs): + self, router=None, server_name=None, network=None, **kwargs): """Create network resources and a server. Creating a network, subnet, router, keypair, security group and a server. """ - self.network = self.create_network() + self.network = network or self.create_network() LOG.debug("Created network %s", self.network['name']) self.subnet = self.create_subnet(self.network) LOG.debug("Created subnet %s", self.subnet['id']) diff --git a/neutron_tempest_plugin/scenario/test_internal_dns.py b/neutron_tempest_plugin/scenario/test_internal_dns.py index dd897277..fadabb0d 100644 --- a/neutron_tempest_plugin/scenario/test_internal_dns.py +++ b/neutron_tempest_plugin/scenario/test_internal_dns.py @@ -27,16 +27,17 @@ class InternalDNSTest(base.BaseTempestTestCase): @utils.requires_ext(extension="dns-integration", service="network") @decorators.idempotent_id('988347de-07af-471a-abfa-65aea9f452a6') - def test_dns_name(self): + def test_dns_domain_and_name(self): """Test the ability to ping a VM's hostname from another VM. 1) Create two VMs on the same network, giving each a name 2) SSH in to the first VM: 2.1) ping the other VM's internal IP - 2.2) ping the otheR VM's hostname + 2.2) ping the other VM's hostname """ - self.setup_network_and_server(server_name='luke') + network = self.create_network(dns_domain='starwars.') + self.setup_network_and_server(network=network, server_name='luke') self.create_pingable_secgroup_rule( secgroup_id=self.security_groups[-1]['id']) self.check_connectivity(self.fip['floating_ip_address'], @@ -70,4 +71,8 @@ class InternalDNSTest(base.BaseTempestTestCase): self.check_remote_connectivity( ssh_client, leia_port['fixed_ips'][0]['ip_address'], timeout=CONF.validation.ping_timeout * 10) + self.assertIn( + 'starwars', ssh_client.exec_command('cat /etc/resolv.conf')) + self.check_remote_connectivity(ssh_client, 'leia') + self.check_remote_connectivity(ssh_client, 'leia.starwars')