Browse Source

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
changes/15/375015/13
Ryan Beisner 2 years ago
parent
commit
cf162a96fc

+ 1
- 1
hooks/charmhelpers/contrib/openstack/amulet/deployment.py View File

@@ -156,7 +156,7 @@ class OpenStackAmuletDeployment(AmuletDeployment):
156 156
         use_source = list(set(
157 157
             use_source + ['mysql', 'mongodb', 'rabbitmq-server', 'ceph',
158 158
                           'ceph-osd', 'ceph-radosgw', 'ceph-mon',
159
-                          'ceph-proxy']))
159
+                          'ceph-proxy', 'percona-cluster', 'lxd']))
160 160
 
161 161
         # Charms which can not use openstack-origin, ie. many subordinates
162 162
         no_origin = list(set(

+ 4
- 7
hooks/charmhelpers/contrib/openstack/amulet/utils.py View File

@@ -306,10 +306,8 @@ class OpenStackAmuletUtils(AmuletUtils):
306 306
                                   password, tenant):
307 307
         """Authenticates admin user with cinder."""
308 308
         # NOTE(beisner): cinder python client doesn't accept tokens.
309
-        service_ip = \
310
-            keystone_sentry.relation('shared-db',
311
-                                     'mysql:shared-db')['private-address']
312
-        ept = "http://{}:5000/v2.0".format(service_ip.strip().decode('utf-8'))
309
+        keystone_ip = keystone_sentry.info['public-address']
310
+        ept = "http://{}:5000/v2.0".format(keystone_ip.strip().decode('utf-8'))
313 311
         return cinder_client.Client(username, password, tenant, ept)
314 312
 
315 313
     def authenticate_keystone_admin(self, keystone_sentry, user, password,
@@ -317,10 +315,9 @@ class OpenStackAmuletUtils(AmuletUtils):
317 315
                                     keystone_ip=None):
318 316
         """Authenticates admin user with the keystone admin endpoint."""
319 317
         self.log.debug('Authenticating keystone admin...')
320
-        unit = keystone_sentry
321 318
         if not keystone_ip:
322
-            keystone_ip = unit.relation('shared-db',
323
-                                        'mysql:shared-db')['private-address']
319
+            keystone_ip = keystone_sentry.info['public-address']
320
+
324 321
         base_ep = "http://{}:35357".format(keystone_ip.strip().decode('utf-8'))
325 322
         if not api_version or api_version == 2:
326 323
             ep = base_ep + "/v2.0"

+ 3
- 2
hooks/charmhelpers/contrib/openstack/utils.py View File

@@ -229,6 +229,7 @@ GIT_DEFAULT_REPOS = {
229 229
 GIT_DEFAULT_BRANCHES = {
230 230
     'liberty': 'stable/liberty',
231 231
     'mitaka': 'stable/mitaka',
232
+    'newton': 'stable/newton',
232 233
     'master': 'master',
233 234
 }
234 235
 
@@ -735,12 +736,12 @@ def git_os_codename_install_source(projects_yaml):
735 736
 
736 737
         if projects in GIT_DEFAULT_BRANCHES.keys():
737 738
             if projects == 'master':
738
-                return 'newton'
739
+                return 'ocata'
739 740
             return projects
740 741
 
741 742
         if 'release' in projects:
742 743
             if projects['release'] == 'master':
743
-                return 'newton'
744
+                return 'ocata'
744 745
             return projects['release']
745 746
 
746 747
     return None

+ 16
- 13
tests/basic_deployment.py View File

@@ -50,9 +50,10 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
50 50
 
51 51
         # XXX: cinder-backup workload status ignored until it grows support
52 52
         #      https://bugs.launchpad.net/bugs/1604580
53
-        exclude_services = ['mysql', 'cinder-backup']
53
+        exclude_services = ['cinder-backup']
54 54
         self._auto_wait_for_status(exclude_services=exclude_services)
55 55
 
56
+        self.d.sentry.wait()
56 57
         self._initialize_tests()
57 58
 
58 59
     def _add_services(self):
@@ -63,12 +64,12 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
63 64
         # Note: cinder-backup becomes a cinder subordinate unit.
64 65
         this_service = {'name': 'cinder-backup'}
65 66
         other_services = [
66
-            {'name': 'mysql'},
67
+            {'name': 'percona-cluster', 'constraints': {'mem': '3072M'}},
67 68
             {'name': 'keystone'},
68 69
             {'name': 'rabbitmq-server'},
69 70
             {'name': 'ceph', 'units': 3},
70 71
             {'name': 'cinder'},
71
-            {'name': 'cinder-ceph'}
72
+            {'name': 'cinder-ceph'},
72 73
         ]
73 74
         super(CinderBackupBasicDeployment, self)._add_services(this_service,
74 75
                                                                other_services)
@@ -81,8 +82,8 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
81 82
             'cinder-ceph:ceph': 'ceph:client',
82 83
             'cinder:storage-backend': 'cinder-ceph:storage-backend',
83 84
             'cinder:backup-backend': 'cinder-backup:backup-backend',
84
-            'keystone:shared-db': 'mysql:shared-db',
85
-            'cinder:shared-db': 'mysql:shared-db',
85
+            'keystone:shared-db': 'percona-cluster:shared-db',
86
+            'cinder:shared-db': 'percona-cluster:shared-db',
86 87
             'cinder:identity-service': 'keystone:identity-service',
87 88
             'cinder:amqp': 'rabbitmq-server:amqp',
88 89
         }
@@ -94,8 +95,11 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
94 95
             'admin-password': 'openstack',
95 96
             'admin-token': 'ubuntutesting'
96 97
         }
97
-        mysql_config = {
98
-            'dataset-size': '50%'
98
+        pxc_config = {
99
+            'dataset-size': '25%',
100
+            'max-connections': 1000,
101
+            'root-password': 'ChangeMe123',
102
+            'sst-password': 'ChangeMe123',
99 103
         }
100 104
         cinder_config = {
101 105
             'block-device': 'None',
@@ -115,18 +119,18 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
115 119
         }
116 120
         configs = {
117 121
             'keystone': keystone_config,
118
-            'mysql': mysql_config,
122
+            'percona-cluster': pxc_config,
119 123
             'cinder': cinder_config,
120 124
             'ceph': ceph_config,
121 125
             'cinder-ceph': cinder_ceph_config,
122
-            'cinder-backup': cinder_ceph_config
126
+            'cinder-backup': cinder_ceph_config,
123 127
         }
124 128
         super(CinderBackupBasicDeployment, self)._configure_services(configs)
125 129
 
126 130
     def _initialize_tests(self):
127 131
         """Perform final initialization before tests get run."""
128 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 134
         self.keystone_sentry = self.d.sentry['keystone'][0]
131 135
         self.rabbitmq_sentry = self.d.sentry['rabbitmq-server'][0]
132 136
         self.cinder_sentry = self.d.sentry['cinder'][0]
@@ -201,7 +205,6 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
201 205
     def test_102_services(self):
202 206
         """Verify the expected services are running on the service units."""
203 207
         services = {
204
-            self.mysql_sentry: ['mysql'],
205 208
             self.rabbitmq_sentry: ['rabbitmq-server'],
206 209
             self.keystone_sentry: ['keystone'],
207 210
             self.cinder_sentry: ['cinder-api',
@@ -423,7 +426,7 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
423 426
     def test_204_mysql_cinder_db_relation(self):
424 427
         """Verify the mysql:glance shared-db relation data"""
425 428
         u.log.debug('Checking mysql:cinder db relation data...')
426
-        unit = self.mysql_sentry
429
+        unit = self.pxc_sentry
427 430
         relation = ['shared-db', 'cinder:shared-db']
428 431
         expected = {
429 432
             'private-address': u.valid_ip,
@@ -438,7 +441,7 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
438 441
         """Verify the cinder:mysql shared-db relation data"""
439 442
         u.log.debug('Checking cinder:mysql db relation data...')
440 443
         unit = self.cinder_sentry
441
-        relation = ['shared-db', 'mysql:shared-db']
444
+        relation = ['shared-db', 'percona-cluster:shared-db']
442 445
         expected = {
443 446
             'private-address': u.valid_ip,
444 447
             'hostname': u.valid_ip,

+ 1
- 1
tests/charmhelpers/contrib/openstack/amulet/deployment.py View File

@@ -156,7 +156,7 @@ class OpenStackAmuletDeployment(AmuletDeployment):
156 156
         use_source = list(set(
157 157
             use_source + ['mysql', 'mongodb', 'rabbitmq-server', 'ceph',
158 158
                           'ceph-osd', 'ceph-radosgw', 'ceph-mon',
159
-                          'ceph-proxy']))
159
+                          'ceph-proxy', 'percona-cluster', 'lxd']))
160 160
 
161 161
         # Charms which can not use openstack-origin, ie. many subordinates
162 162
         no_origin = list(set(

+ 4
- 7
tests/charmhelpers/contrib/openstack/amulet/utils.py View File

@@ -306,10 +306,8 @@ class OpenStackAmuletUtils(AmuletUtils):
306 306
                                   password, tenant):
307 307
         """Authenticates admin user with cinder."""
308 308
         # NOTE(beisner): cinder python client doesn't accept tokens.
309
-        service_ip = \
310
-            keystone_sentry.relation('shared-db',
311
-                                     'mysql:shared-db')['private-address']
312
-        ept = "http://{}:5000/v2.0".format(service_ip.strip().decode('utf-8'))
309
+        keystone_ip = keystone_sentry.info['public-address']
310
+        ept = "http://{}:5000/v2.0".format(keystone_ip.strip().decode('utf-8'))
313 311
         return cinder_client.Client(username, password, tenant, ept)
314 312
 
315 313
     def authenticate_keystone_admin(self, keystone_sentry, user, password,
@@ -317,10 +315,9 @@ class OpenStackAmuletUtils(AmuletUtils):
317 315
                                     keystone_ip=None):
318 316
         """Authenticates admin user with the keystone admin endpoint."""
319 317
         self.log.debug('Authenticating keystone admin...')
320
-        unit = keystone_sentry
321 318
         if not keystone_ip:
322
-            keystone_ip = unit.relation('shared-db',
323
-                                        'mysql:shared-db')['private-address']
319
+            keystone_ip = keystone_sentry.info['public-address']
320
+
324 321
         base_ep = "http://{}:35357".format(keystone_ip.strip().decode('utf-8'))
325 322
         if not api_version or api_version == 2:
326 323
             ep = base_ep + "/v2.0"

+ 0
- 25
tests/gate-basic-precise-icehouse View File

@@ -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
-
19
-from basic_deployment import CinderBackupBasicDeployment
20
-
21
-if __name__ == '__main__':
22
-    deployment = CinderBackupBasicDeployment(series='precise',
23
-                                             openstack='cloud:precise-icehouse',
24
-                                             source='cloud:precise-updates/icehouse')
25
-    deployment.run_tests()

tests/dev-basic-xenial-newton → tests/gate-basic-xenial-newton View File


tests/dev-basic-yakkety-newton → tests/gate-basic-yakkety-newton View File


+ 1
- 1
tests/tests.yaml View File

@@ -1,6 +1,6 @@
1 1
 # Bootstrap the model if necessary.
2 2
 bootstrap: True
3
-# Re-use bootstrap node instead of destroying/re-bootstrapping.
3
+# Re-use bootstrap node.
4 4
 reset: True
5 5
 # Use tox/requirements to drive the venv instead of bundletester's venv feature.
6 6
 virtualenv: False

Loading…
Cancel
Save