From 4c34497384c011fed242fdb2c5e0f8e978d41b21 Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Mon, 13 Apr 2015 19:32:33 +0000 Subject: [PATCH 1/4] update amulet test re: bug 1442268 --- tests/basic_deployment.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index 25ec8473..5007bc27 100755 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -301,7 +301,7 @@ class CinderBasicDeployment(OpenStackAmuletDeployment): 'auth_protocol': 'http', 'private-address': u.valid_ip, 'auth_host': u.valid_ip, - 'service_username': 'cinder', + 'service_username': 'cinder_cinderv2', 'service_tenant_id': u.not_null, 'service_host': u.valid_ip } @@ -317,11 +317,11 @@ class CinderBasicDeployment(OpenStackAmuletDeployment): relation = ['identity-service', 'keystone:identity-service'] expected = { - 'service': 'cinder', - 'region': 'RegionOne', - 'public_url': u.valid_url, - 'internal_url': u.valid_url, - 'admin_url': u.valid_url, + 'cinder_service': 'cinder', + 'cinder_region': 'RegionOne', + 'cinder_public_url': u.valid_url, + 'cinder_internal_url': u.valid_url, + 'cinder_admin_url': u.valid_url, 'private-address': u.valid_ip } u.log.debug('') @@ -508,7 +508,7 @@ class CinderBasicDeployment(OpenStackAmuletDeployment): def test_users(self): '''Verify expected users.''' - user0 = {'name': 'cinder', + user0 = {'name': 'cinder_cinderv2', 'enabled': True, 'tenantId': u.not_null, 'id': u.not_null, From ba1f9692147744343b6572b0d575ec419e8330c8 Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Mon, 13 Apr 2015 19:33:14 +0000 Subject: [PATCH 2/4] rename kilo amulet tests for consistency --- tests/{16-vivid-kilo => 16-basic-vivid-kilo} | 0 tests/{17-trusty-kilo => 17-basic-trusty-kilo} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tests/{16-vivid-kilo => 16-basic-vivid-kilo} (100%) rename tests/{17-trusty-kilo => 17-basic-trusty-kilo} (100%) diff --git a/tests/16-vivid-kilo b/tests/16-basic-vivid-kilo similarity index 100% rename from tests/16-vivid-kilo rename to tests/16-basic-vivid-kilo diff --git a/tests/17-trusty-kilo b/tests/17-basic-trusty-kilo similarity index 100% rename from tests/17-trusty-kilo rename to tests/17-basic-trusty-kilo From c889fa170b688e1e982b5fc061e812a9201a1c23 Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Mon, 13 Apr 2015 19:39:27 +0000 Subject: [PATCH 3/4] bump timeout in amulet test for volume operations --- tests/basic_deployment.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py index 5007bc27..b7b468f8 100755 --- a/tests/basic_deployment.py +++ b/tests/basic_deployment.py @@ -169,9 +169,9 @@ class CinderBasicDeployment(OpenStackAmuletDeployment): obj_count) def obj_is_status(self, obj, obj_id, stat='available', - msg='openstack object status check', max_wait=60): + msg='openstack object status check', max_wait=120): ''''Wait for an openstack object status to be as expected. - By default, expect an available status within 60s. Useful + By default, expect an available status within 120s. Useful when confirming cinder volumes, snapshots, glance images, etc. reach a certain state/status within a specified time.''' # NOTE(beisner): need to move to charmhelpers, and adjust calls here. From 1a7d6aa36d5200fbd6cf985e2aa0fe864ed74fce Mon Sep 17 00:00:00 2001 From: Ryan Beisner Date: Mon, 13 Apr 2015 19:41:31 +0000 Subject: [PATCH 4/4] sync charm helpers --- hooks/charmhelpers/contrib/openstack/context.py | 15 +++++++++++++++ hooks/charmhelpers/contrib/openstack/neutron.py | 13 +++++++++++++ .../contrib/openstack/templates/git.upstart | 4 ++++ hooks/charmhelpers/core/strutils.py | 4 ++-- 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/hooks/charmhelpers/contrib/openstack/context.py b/hooks/charmhelpers/contrib/openstack/context.py index dd51bfbb..c9914d0d 100644 --- a/hooks/charmhelpers/contrib/openstack/context.py +++ b/hooks/charmhelpers/contrib/openstack/context.py @@ -808,6 +808,19 @@ class NeutronContext(OSContextGenerator): return ovs_ctxt + def nuage_ctxt(self): + driver = neutron_plugin_attribute(self.plugin, 'driver', + self.network_manager) + config = neutron_plugin_attribute(self.plugin, 'config', + self.network_manager) + nuage_ctxt = {'core_plugin': driver, + 'neutron_plugin': 'vsp', + 'neutron_security_groups': self.neutron_security_groups, + 'local_ip': unit_private_ip(), + 'config': config} + + return nuage_ctxt + def nvp_ctxt(self): driver = neutron_plugin_attribute(self.plugin, 'driver', self.network_manager) @@ -891,6 +904,8 @@ class NeutronContext(OSContextGenerator): ctxt.update(self.n1kv_ctxt()) elif self.plugin == 'Calico': ctxt.update(self.calico_ctxt()) + elif self.plugin == 'vsp': + ctxt.update(self.nuage_ctxt()) alchemy_flags = config('neutron-alchemy-flags') if alchemy_flags: diff --git a/hooks/charmhelpers/contrib/openstack/neutron.py b/hooks/charmhelpers/contrib/openstack/neutron.py index f8851050..02c92e9c 100644 --- a/hooks/charmhelpers/contrib/openstack/neutron.py +++ b/hooks/charmhelpers/contrib/openstack/neutron.py @@ -180,6 +180,19 @@ def neutron_plugins(): 'nova-api-metadata']], 'server_packages': ['neutron-server', 'calico-control'], 'server_services': ['neutron-server'] + }, + 'vsp': { + 'config': '/etc/neutron/plugins/nuage/nuage_plugin.ini', + 'driver': 'neutron.plugins.nuage.plugin.NuagePlugin', + 'contexts': [ + context.SharedDBContext(user=config('neutron-database-user'), + database=config('neutron-database'), + relation_prefix='neutron', + ssl_dir=NEUTRON_CONF_DIR)], + 'services': [], + 'packages': [], + 'server_packages': ['neutron-server', 'neutron-plugin-nuage'], + 'server_services': ['neutron-server'] } } if release >= 'icehouse': diff --git a/hooks/charmhelpers/contrib/openstack/templates/git.upstart b/hooks/charmhelpers/contrib/openstack/templates/git.upstart index da94ad12..4bed404b 100644 --- a/hooks/charmhelpers/contrib/openstack/templates/git.upstart +++ b/hooks/charmhelpers/contrib/openstack/templates/git.upstart @@ -9,5 +9,9 @@ respawn exec start-stop-daemon --start --chuid {{ user_name }} \ --chdir {{ start_dir }} --name {{ process_name }} \ --exec {{ executable_name }} -- \ + {% for config_file in config_files -%} --config-file={{ config_file }} \ + {% endfor -%} + {% if log_file -%} --log-file={{ log_file }} + {% endif -%} diff --git a/hooks/charmhelpers/core/strutils.py b/hooks/charmhelpers/core/strutils.py index efc4402e..a2a784aa 100644 --- a/hooks/charmhelpers/core/strutils.py +++ b/hooks/charmhelpers/core/strutils.py @@ -33,9 +33,9 @@ def bool_from_string(value): value = value.strip().lower() - if value in ['y', 'yes', 'true', 't']: + if value in ['y', 'yes', 'true', 't', 'on']: return True - elif value in ['n', 'no', 'false', 'f']: + elif value in ['n', 'no', 'false', 'f', 'off']: return False msg = "Unable to interpret string value '%s' as boolean" % (value)