summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Beisner <ryan.beisner@canonical.com>2016-09-22 17:57:58 +0000
committerRyan Beisner <ryan.beisner@canonical.com>2016-10-10 20:54:06 -0500
commitcf162a96fcc89458cab7991790a956e0edc28e1f (patch)
tree7c5ddfdbec249526dc7690763cb90b46b9c0dd0e
parent49b75b04bc0c58d0ce03a7f78f0e3660316a3452 (diff)
Update amulet test definitions for Newton
- Remove Precise-Icehouse Amulet test definitions if they exist. - Add Xenial-Newton Amulet test definitions. - Add Yakkety-Newton Amulet test definitions. - Use the percona-cluster charm in tests instead of the mysql charm. Change-Id: I284cd94772f2e5d38342330910e835b4feef58af
Notes
Notes (review): Verified+1: Canonical CI <uosci-testing-bot@ubuntu.com> Code-Review+1: Ryan Beisner <ryan.beisner@canonical.com> Code-Review+2: James Page <james.page@canonical.com> Workflow+1: James Page <james.page@canonical.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Wed, 12 Oct 2016 11:45:51 +0000 Reviewed-on: https://review.openstack.org/375015 Project: openstack/charm-cinder-backup Branch: refs/heads/master
-rw-r--r--hooks/charmhelpers/contrib/openstack/amulet/deployment.py2
-rw-r--r--hooks/charmhelpers/contrib/openstack/amulet/utils.py11
-rw-r--r--hooks/charmhelpers/contrib/openstack/utils.py5
-rw-r--r--tests/basic_deployment.py29
-rw-r--r--tests/charmhelpers/contrib/openstack/amulet/deployment.py2
-rw-r--r--tests/charmhelpers/contrib/openstack/amulet/utils.py11
-rwxr-xr-xtests/gate-basic-precise-icehouse25
-rwxr-xr-xtests/gate-basic-xenial-newton (renamed from tests/dev-basic-xenial-newton)0
-rw-r--r--[-rwxr-xr-x]tests/gate-basic-yakkety-newton (renamed from tests/dev-basic-yakkety-newton)0
-rw-r--r--tests/tests.yaml2
10 files changed, 30 insertions, 57 deletions
diff --git a/hooks/charmhelpers/contrib/openstack/amulet/deployment.py b/hooks/charmhelpers/contrib/openstack/amulet/deployment.py
index 6fe8cf8..9e0b07f 100644
--- a/hooks/charmhelpers/contrib/openstack/amulet/deployment.py
+++ b/hooks/charmhelpers/contrib/openstack/amulet/deployment.py
@@ -156,7 +156,7 @@ class OpenStackAmuletDeployment(AmuletDeployment):
156 use_source = list(set( 156 use_source = list(set(
157 use_source + ['mysql', 'mongodb', 'rabbitmq-server', 'ceph', 157 use_source + ['mysql', 'mongodb', 'rabbitmq-server', 'ceph',
158 'ceph-osd', 'ceph-radosgw', 'ceph-mon', 158 'ceph-osd', 'ceph-radosgw', 'ceph-mon',
159 'ceph-proxy'])) 159 'ceph-proxy', 'percona-cluster', 'lxd']))
160 160
161 # Charms which can not use openstack-origin, ie. many subordinates 161 # Charms which can not use openstack-origin, ie. many subordinates
162 no_origin = list(set( 162 no_origin = list(set(
diff --git a/hooks/charmhelpers/contrib/openstack/amulet/utils.py b/hooks/charmhelpers/contrib/openstack/amulet/utils.py
index 24b353e..e4546c8 100644
--- a/hooks/charmhelpers/contrib/openstack/amulet/utils.py
+++ b/hooks/charmhelpers/contrib/openstack/amulet/utils.py
@@ -306,10 +306,8 @@ class OpenStackAmuletUtils(AmuletUtils):
306 password, tenant): 306 password, tenant):
307 """Authenticates admin user with cinder.""" 307 """Authenticates admin user with cinder."""
308 # NOTE(beisner): cinder python client doesn't accept tokens. 308 # NOTE(beisner): cinder python client doesn't accept tokens.
309 service_ip = \ 309 keystone_ip = keystone_sentry.info['public-address']
310 keystone_sentry.relation('shared-db', 310 ept = "http://{}:5000/v2.0".format(keystone_ip.strip().decode('utf-8'))
311 'mysql:shared-db')['private-address']
312 ept = "http://{}:5000/v2.0".format(service_ip.strip().decode('utf-8'))
313 return cinder_client.Client(username, password, tenant, ept) 311 return cinder_client.Client(username, password, tenant, ept)
314 312
315 def authenticate_keystone_admin(self, keystone_sentry, user, password, 313 def authenticate_keystone_admin(self, keystone_sentry, user, password,
@@ -317,10 +315,9 @@ class OpenStackAmuletUtils(AmuletUtils):
317 keystone_ip=None): 315 keystone_ip=None):
318 """Authenticates admin user with the keystone admin endpoint.""" 316 """Authenticates admin user with the keystone admin endpoint."""
319 self.log.debug('Authenticating keystone admin...') 317 self.log.debug('Authenticating keystone admin...')
320 unit = keystone_sentry
321 if not keystone_ip: 318 if not keystone_ip:
322 keystone_ip = unit.relation('shared-db', 319 keystone_ip = keystone_sentry.info['public-address']
323 'mysql:shared-db')['private-address'] 320
324 base_ep = "http://{}:35357".format(keystone_ip.strip().decode('utf-8')) 321 base_ep = "http://{}:35357".format(keystone_ip.strip().decode('utf-8'))
325 if not api_version or api_version == 2: 322 if not api_version or api_version == 2:
326 ep = base_ep + "/v2.0" 323 ep = base_ep + "/v2.0"
diff --git a/hooks/charmhelpers/contrib/openstack/utils.py b/hooks/charmhelpers/contrib/openstack/utils.py
index 9abd4c3..8c89c3a 100644
--- a/hooks/charmhelpers/contrib/openstack/utils.py
+++ b/hooks/charmhelpers/contrib/openstack/utils.py
@@ -229,6 +229,7 @@ GIT_DEFAULT_REPOS = {
229GIT_DEFAULT_BRANCHES = { 229GIT_DEFAULT_BRANCHES = {
230 'liberty': 'stable/liberty', 230 'liberty': 'stable/liberty',
231 'mitaka': 'stable/mitaka', 231 'mitaka': 'stable/mitaka',
232 'newton': 'stable/newton',
232 'master': 'master', 233 'master': 'master',
233} 234}
234 235
@@ -735,12 +736,12 @@ def git_os_codename_install_source(projects_yaml):
735 736
736 if projects in GIT_DEFAULT_BRANCHES.keys(): 737 if projects in GIT_DEFAULT_BRANCHES.keys():
737 if projects == 'master': 738 if projects == 'master':
738 return 'newton' 739 return 'ocata'
739 return projects 740 return projects
740 741
741 if 'release' in projects: 742 if 'release' in projects:
742 if projects['release'] == 'master': 743 if projects['release'] == 'master':
743 return 'newton' 744 return 'ocata'
744 return projects['release'] 745 return projects['release']
745 746
746 return None 747 return None
diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py
index 43d63f9..dab1f75 100644
--- a/tests/basic_deployment.py
+++ b/tests/basic_deployment.py
@@ -50,9 +50,10 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
50 50
51 # XXX: cinder-backup workload status ignored until it grows support 51 # XXX: cinder-backup workload status ignored until it grows support
52 # https://bugs.launchpad.net/bugs/1604580 52 # https://bugs.launchpad.net/bugs/1604580
53 exclude_services = ['mysql', 'cinder-backup'] 53 exclude_services = ['cinder-backup']
54 self._auto_wait_for_status(exclude_services=exclude_services) 54 self._auto_wait_for_status(exclude_services=exclude_services)
55 55
56 self.d.sentry.wait()
56 self._initialize_tests() 57 self._initialize_tests()
57 58
58 def _add_services(self): 59 def _add_services(self):
@@ -63,12 +64,12 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
63 # Note: cinder-backup becomes a cinder subordinate unit. 64 # Note: cinder-backup becomes a cinder subordinate unit.
64 this_service = {'name': 'cinder-backup'} 65 this_service = {'name': 'cinder-backup'}
65 other_services = [ 66 other_services = [
66 {'name': 'mysql'}, 67 {'name': 'percona-cluster', 'constraints': {'mem': '3072M'}},
67 {'name': 'keystone'}, 68 {'name': 'keystone'},
68 {'name': 'rabbitmq-server'}, 69 {'name': 'rabbitmq-server'},
69 {'name': 'ceph', 'units': 3}, 70 {'name': 'ceph', 'units': 3},
70 {'name': 'cinder'}, 71 {'name': 'cinder'},
71 {'name': 'cinder-ceph'} 72 {'name': 'cinder-ceph'},
72 ] 73 ]
73 super(CinderBackupBasicDeployment, self)._add_services(this_service, 74 super(CinderBackupBasicDeployment, self)._add_services(this_service,
74 other_services) 75 other_services)
@@ -81,8 +82,8 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
81 'cinder-ceph:ceph': 'ceph:client', 82 'cinder-ceph:ceph': 'ceph:client',
82 'cinder:storage-backend': 'cinder-ceph:storage-backend', 83 'cinder:storage-backend': 'cinder-ceph:storage-backend',
83 'cinder:backup-backend': 'cinder-backup:backup-backend', 84 'cinder:backup-backend': 'cinder-backup:backup-backend',
84 'keystone:shared-db': 'mysql:shared-db', 85 'keystone:shared-db': 'percona-cluster:shared-db',
85 'cinder:shared-db': 'mysql:shared-db', 86 'cinder:shared-db': 'percona-cluster:shared-db',
86 'cinder:identity-service': 'keystone:identity-service', 87 'cinder:identity-service': 'keystone:identity-service',
87 'cinder:amqp': 'rabbitmq-server:amqp', 88 'cinder:amqp': 'rabbitmq-server:amqp',
88 } 89 }
@@ -94,8 +95,11 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
94 'admin-password': 'openstack', 95 'admin-password': 'openstack',
95 'admin-token': 'ubuntutesting' 96 'admin-token': 'ubuntutesting'
96 } 97 }
97 mysql_config = { 98 pxc_config = {
98 'dataset-size': '50%' 99 'dataset-size': '25%',
100 'max-connections': 1000,
101 'root-password': 'ChangeMe123',
102 'sst-password': 'ChangeMe123',
99 } 103 }
100 cinder_config = { 104 cinder_config = {
101 'block-device': 'None', 105 'block-device': 'None',
@@ -115,18 +119,18 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
115 } 119 }
116 configs = { 120 configs = {
117 'keystone': keystone_config, 121 'keystone': keystone_config,
118 'mysql': mysql_config, 122 'percona-cluster': pxc_config,
119 'cinder': cinder_config, 123 'cinder': cinder_config,
120 'ceph': ceph_config, 124 'ceph': ceph_config,
121 'cinder-ceph': cinder_ceph_config, 125 'cinder-ceph': cinder_ceph_config,
122 'cinder-backup': cinder_ceph_config 126 'cinder-backup': cinder_ceph_config,
123 } 127 }
124 super(CinderBackupBasicDeployment, self)._configure_services(configs) 128 super(CinderBackupBasicDeployment, self)._configure_services(configs)
125 129
126 def _initialize_tests(self): 130 def _initialize_tests(self):
127 """Perform final initialization before tests get run.""" 131 """Perform final initialization before tests get run."""
128 # Access the sentries for inspecting service units 132 # Access the sentries for inspecting service units
129 self.mysql_sentry = self.d.sentry['mysql'][0] 133 self.pxc_sentry = self.d.sentry['percona-cluster'][0]
130 self.keystone_sentry = self.d.sentry['keystone'][0] 134 self.keystone_sentry = self.d.sentry['keystone'][0]
131 self.rabbitmq_sentry = self.d.sentry['rabbitmq-server'][0] 135 self.rabbitmq_sentry = self.d.sentry['rabbitmq-server'][0]
132 self.cinder_sentry = self.d.sentry['cinder'][0] 136 self.cinder_sentry = self.d.sentry['cinder'][0]
@@ -201,7 +205,6 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
201 def test_102_services(self): 205 def test_102_services(self):
202 """Verify the expected services are running on the service units.""" 206 """Verify the expected services are running on the service units."""
203 services = { 207 services = {
204 self.mysql_sentry: ['mysql'],
205 self.rabbitmq_sentry: ['rabbitmq-server'], 208 self.rabbitmq_sentry: ['rabbitmq-server'],
206 self.keystone_sentry: ['keystone'], 209 self.keystone_sentry: ['keystone'],
207 self.cinder_sentry: ['cinder-api', 210 self.cinder_sentry: ['cinder-api',
@@ -423,7 +426,7 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
423 def test_204_mysql_cinder_db_relation(self): 426 def test_204_mysql_cinder_db_relation(self):
424 """Verify the mysql:glance shared-db relation data""" 427 """Verify the mysql:glance shared-db relation data"""
425 u.log.debug('Checking mysql:cinder db relation data...') 428 u.log.debug('Checking mysql:cinder db relation data...')
426 unit = self.mysql_sentry 429 unit = self.pxc_sentry
427 relation = ['shared-db', 'cinder:shared-db'] 430 relation = ['shared-db', 'cinder:shared-db']
428 expected = { 431 expected = {
429 'private-address': u.valid_ip, 432 'private-address': u.valid_ip,
@@ -438,7 +441,7 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
438 """Verify the cinder:mysql shared-db relation data""" 441 """Verify the cinder:mysql shared-db relation data"""
439 u.log.debug('Checking cinder:mysql db relation data...') 442 u.log.debug('Checking cinder:mysql db relation data...')
440 unit = self.cinder_sentry 443 unit = self.cinder_sentry
441 relation = ['shared-db', 'mysql:shared-db'] 444 relation = ['shared-db', 'percona-cluster:shared-db']
442 expected = { 445 expected = {
443 'private-address': u.valid_ip, 446 'private-address': u.valid_ip,
444 'hostname': u.valid_ip, 447 'hostname': u.valid_ip,
diff --git a/tests/charmhelpers/contrib/openstack/amulet/deployment.py b/tests/charmhelpers/contrib/openstack/amulet/deployment.py
index 6fe8cf8..9e0b07f 100644
--- a/tests/charmhelpers/contrib/openstack/amulet/deployment.py
+++ b/tests/charmhelpers/contrib/openstack/amulet/deployment.py
@@ -156,7 +156,7 @@ class OpenStackAmuletDeployment(AmuletDeployment):
156 use_source = list(set( 156 use_source = list(set(
157 use_source + ['mysql', 'mongodb', 'rabbitmq-server', 'ceph', 157 use_source + ['mysql', 'mongodb', 'rabbitmq-server', 'ceph',
158 'ceph-osd', 'ceph-radosgw', 'ceph-mon', 158 'ceph-osd', 'ceph-radosgw', 'ceph-mon',
159 'ceph-proxy'])) 159 'ceph-proxy', 'percona-cluster', 'lxd']))
160 160
161 # Charms which can not use openstack-origin, ie. many subordinates 161 # Charms which can not use openstack-origin, ie. many subordinates
162 no_origin = list(set( 162 no_origin = list(set(
diff --git a/tests/charmhelpers/contrib/openstack/amulet/utils.py b/tests/charmhelpers/contrib/openstack/amulet/utils.py
index 24b353e..e4546c8 100644
--- a/tests/charmhelpers/contrib/openstack/amulet/utils.py
+++ b/tests/charmhelpers/contrib/openstack/amulet/utils.py
@@ -306,10 +306,8 @@ class OpenStackAmuletUtils(AmuletUtils):
306 password, tenant): 306 password, tenant):
307 """Authenticates admin user with cinder.""" 307 """Authenticates admin user with cinder."""
308 # NOTE(beisner): cinder python client doesn't accept tokens. 308 # NOTE(beisner): cinder python client doesn't accept tokens.
309 service_ip = \ 309 keystone_ip = keystone_sentry.info['public-address']
310 keystone_sentry.relation('shared-db', 310 ept = "http://{}:5000/v2.0".format(keystone_ip.strip().decode('utf-8'))
311 'mysql:shared-db')['private-address']
312 ept = "http://{}:5000/v2.0".format(service_ip.strip().decode('utf-8'))
313 return cinder_client.Client(username, password, tenant, ept) 311 return cinder_client.Client(username, password, tenant, ept)
314 312
315 def authenticate_keystone_admin(self, keystone_sentry, user, password, 313 def authenticate_keystone_admin(self, keystone_sentry, user, password,
@@ -317,10 +315,9 @@ class OpenStackAmuletUtils(AmuletUtils):
317 keystone_ip=None): 315 keystone_ip=None):
318 """Authenticates admin user with the keystone admin endpoint.""" 316 """Authenticates admin user with the keystone admin endpoint."""
319 self.log.debug('Authenticating keystone admin...') 317 self.log.debug('Authenticating keystone admin...')
320 unit = keystone_sentry
321 if not keystone_ip: 318 if not keystone_ip:
322 keystone_ip = unit.relation('shared-db', 319 keystone_ip = keystone_sentry.info['public-address']
323 'mysql:shared-db')['private-address'] 320
324 base_ep = "http://{}:35357".format(keystone_ip.strip().decode('utf-8')) 321 base_ep = "http://{}:35357".format(keystone_ip.strip().decode('utf-8'))
325 if not api_version or api_version == 2: 322 if not api_version or api_version == 2:
326 ep = base_ep + "/v2.0" 323 ep = base_ep + "/v2.0"
diff --git a/tests/gate-basic-precise-icehouse b/tests/gate-basic-precise-icehouse
deleted file mode 100755
index 06843b7..0000000
--- a/tests/gate-basic-precise-icehouse
+++ /dev/null
@@ -1,25 +0,0 @@
1#!/usr/bin/env python
2#
3# Copyright 2016 Canonical Ltd
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17"""Amulet tests on a basic cinder-backup deployment on precise-icehouse."""
18
19from basic_deployment import CinderBackupBasicDeployment
20
21if __name__ == '__main__':
22 deployment = CinderBackupBasicDeployment(series='precise',
23 openstack='cloud:precise-icehouse',
24 source='cloud:precise-updates/icehouse')
25 deployment.run_tests()
diff --git a/tests/dev-basic-xenial-newton b/tests/gate-basic-xenial-newton
index 93fcc99..93fcc99 100755
--- a/tests/dev-basic-xenial-newton
+++ b/tests/gate-basic-xenial-newton
diff --git a/tests/dev-basic-yakkety-newton b/tests/gate-basic-yakkety-newton
index c79d7bd..c79d7bd 100755..100644
--- a/tests/dev-basic-yakkety-newton
+++ b/tests/gate-basic-yakkety-newton
diff --git a/tests/tests.yaml b/tests/tests.yaml
index e3185c6..4cf93d0 100644
--- a/tests/tests.yaml
+++ b/tests/tests.yaml
@@ -1,6 +1,6 @@
1# Bootstrap the model if necessary. 1# Bootstrap the model if necessary.
2bootstrap: True 2bootstrap: True
3# Re-use bootstrap node instead of destroying/re-bootstrapping. 3# Re-use bootstrap node.
4reset: True 4reset: True
5# Use tox/requirements to drive the venv instead of bundletester's venv feature. 5# Use tox/requirements to drive the venv instead of bundletester's venv feature.
6virtualenv: False 6virtualenv: False