From 562e570ea6fa4e9b6bef050940bb453eb4878039 Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Sat, 16 Jan 2016 05:16:00 +0000 Subject: [PATCH 1/3] wait for unit status instead of sleeping before amulet tests --- tests/019-basic-trusty-mitaka | 0 tests/basic_deployment.py | 9 +++++---- 2 files changed, 5 insertions(+), 4 deletions(-) mode change 100644 => 100755 tests/019-basic-trusty-mitaka diff --git a/tests/019-basic-trusty-mitaka b/tests/019-basic-trusty-mitaka old mode 100644 new mode 100755 diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index 0d1bde83..c396ac96 100644 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -1,6 +1,5 @@ import amulet import os -import time import yaml from neutronclient.v2_0 import client as neutronclient @@ -32,6 +31,11 @@ class NeutronGatewayBasicDeployment(OpenStackAmuletDeployment): self._add_relations() self._configure_services() self._deploy() + + u.log.info('Waiting on extended status checks...') + exclude_services = ['mysql'] + self._auto_wait_for_status(exclude_services=exclude_services) + self._initialize_tests() def _add_services(self): @@ -154,9 +158,6 @@ class NeutronGatewayBasicDeployment(OpenStackAmuletDeployment): self.neutron_gateway_sentry = self.d.sentry.unit['neutron-gateway/0'] self.neutron_api_sentry = self.d.sentry.unit['neutron-api/0'] - # Let things settle a bit before moving forward - time.sleep(30) - # Authenticate admin with keystone self.keystone = u.authenticate_keystone_admin(self.keystone_sentry, user='admin', From 3b029f27e34e433613a661bb99b7e1565ec009b8 Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Wed, 20 Jan 2016 04:47:13 +0000 Subject: [PATCH 2/3] update test for neutron catalog names (lp1535410) --- tests/basic_deployment.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index c396ac96..db5b000f 100644 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -1,5 +1,6 @@ import amulet import os +import time import yaml from neutronclient.v2_0 import client as neutronclient @@ -31,11 +32,6 @@ class NeutronGatewayBasicDeployment(OpenStackAmuletDeployment): self._add_relations() self._configure_services() self._deploy() - - u.log.info('Waiting on extended status checks...') - exclude_services = ['mysql'] - self._auto_wait_for_status(exclude_services=exclude_services) - self._initialize_tests() def _add_services(self): @@ -158,6 +154,9 @@ class NeutronGatewayBasicDeployment(OpenStackAmuletDeployment): self.neutron_gateway_sentry = self.d.sentry.unit['neutron-gateway/0'] self.neutron_api_sentry = self.d.sentry.unit['neutron-api/0'] + # Let things settle a bit before moving forward + time.sleep(30) + # Authenticate admin with keystone self.keystone = u.authenticate_keystone_admin(self.keystone_sentry, user='admin', @@ -254,7 +253,7 @@ class NeutronGatewayBasicDeployment(OpenStackAmuletDeployment): 'tenantId': u.not_null, 'id': u.not_null, 'email': 'juju@localhost'}, - {'name': 'quantum', + {'name': 'neutron', 'enabled': True, 'tenantId': u.not_null, 'id': u.not_null, @@ -486,11 +485,11 @@ class NeutronGatewayBasicDeployment(OpenStackAmuletDeployment): api_endpoint = 'http://{}:9696'.format(api_ip) expected = { 'private-address': u.valid_ip, - 'quantum_region': 'RegionOne', - 'quantum_service': 'quantum', - 'quantum_admin_url': api_endpoint, - 'quantum_internal_url': api_endpoint, - 'quantum_public_url': api_endpoint, + 'neutron_region': 'RegionOne', + 'neutron_service': 'neutron', + 'neutron_admin_url': api_endpoint, + 'neutron_internal_url': api_endpoint, + 'neutron_public_url': api_endpoint, } ret = u.validate_relation_data(unit, relation, expected) From e5d625a984c22539bca0ae8720ebed7cb9e455d5 Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Fri, 22 Jan 2016 04:29:30 +0000 Subject: [PATCH 3/3] really wait for unit status instead of sleeping before amulet tests --- tests/basic_deployment.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index db5b000f..9aafdad7 100644 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -1,6 +1,5 @@ import amulet import os -import time import yaml from neutronclient.v2_0 import client as neutronclient @@ -32,6 +31,11 @@ class NeutronGatewayBasicDeployment(OpenStackAmuletDeployment): self._add_relations() self._configure_services() self._deploy() + + u.log.info('Waiting on extended status checks...') + exclude_services = ['mysql'] + self._auto_wait_for_status(exclude_services=exclude_services) + self._initialize_tests() def _add_services(self): @@ -154,9 +158,6 @@ class NeutronGatewayBasicDeployment(OpenStackAmuletDeployment): self.neutron_gateway_sentry = self.d.sentry.unit['neutron-gateway/0'] self.neutron_api_sentry = self.d.sentry.unit['neutron-api/0'] - # Let things settle a bit before moving forward - time.sleep(30) - # Authenticate admin with keystone self.keystone = u.authenticate_keystone_admin(self.keystone_sentry, user='admin',