Browse Source

Migrate functional tests from Amulet to Zaza

Migrate glance tests from Amulet to Zaza, which is Python3 only.

func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/50

Partial-Bug: 1828424

Change-Id: I053a056d8e2a79ed22ea8a976a8f378994b1e8eb
Signed-off-by: Joe Guo <guoqiao@gmail.com>
changes/99/679599/8
Joe Guo 1 month ago
parent
commit
35beb586da

+ 3
- 3
Makefile View File

@@ -1,5 +1,5 @@
1 1
 #!/usr/bin/make
2
-PYTHON := /usr/bin/env python
2
+PYTHON := /usr/bin/env python3
3 3
 
4 4
 lint:
5 5
 	@tox -e pep8
@@ -9,8 +9,8 @@ test:
9 9
 	@tox -e py27
10 10
 
11 11
 functional_test:
12
-	@echo Starting functional tests...
13
-	@tox -e func27
12
+	@echo Starting Zaza functional tests...
13
+	@tox -e func
14 14
 
15 15
 bin/charm_helpers_sync.py:
16 16
 	@mkdir -p bin

+ 6
- 25
test-requirements.txt View File

@@ -1,29 +1,10 @@
1
-# The order of packages is significant, because pip processes them in the order
2
-# of appearance. Changing the order has an impact on the overall integration
3
-# process, which may cause wedges in the gate later.
4
-charm-tools>=2.4.4
5
-coverage>=3.6
1
+charm-tools>=2.6.1
2
+requests>=2.18.4
6 3
 mock>=1.2
7 4
 flake8>=2.2.4,<=2.4.1
8 5
 stestr>=2.2.0
9
-requests>=2.18.4
10
-# BEGIN: Amulet OpenStack Charm Helper Requirements
11
-# Liberty client lower constraints
12
-amulet>=1.14.3,<2.0;python_version=='2.7'
13
-bundletester>=0.6.1,<1.0;python_version=='2.7'
14
-python-ceilometerclient>=1.5.0
15
-python-cinderclient>=1.4.0
6
+git+https://github.com/openstack-charmers/zaza.git#egg=zaza;python_version>='3.0'
7
+git+https://github.com/openstack-charmers/zaza-openstack-tests.git#egg=zaza.openstack
8
+coverage>=4.5.2
9
+
16 10
 python-glanceclient>=1.1.0
17
-python-heatclient>=0.8.0
18
-python-keystoneclient>=1.7.1
19
-python-neutronclient>=3.1.0
20
-python-novaclient>=2.30.1
21
-python-openstackclient>=1.7.0
22
-python-swiftclient>=2.6.0
23
-pika>=0.10.0,<1.0
24
-distro-info
25
-git+https://github.com/juju/charm-helpers.git#egg=charmhelpers
26
-# END: Amulet OpenStack Charm Helper Requirements
27
-# NOTE: workaround for 14.04 pip/tox
28
-pytz
29
-pyudev  # for ceph-* charm unit tests (not mocked?)

+ 0
- 9
tests/README.md View File

@@ -1,9 +0,0 @@
1
-# Overview
2
-
3
-This directory provides Amulet tests to verify basic deployment functionality
4
-from the perspective of this charm, its requirements and its features, as
5
-exercised in a subset of the full OpenStack deployment test bundle topology.
6
-
7
-For full details on functional testing of OpenStack charms please refer to
8
-the [functional testing](http://docs.openstack.org/developer/charm-guide/testing.html#functional-testing)
9
-section of the OpenStack Charm Guide.

+ 0
- 553
tests/basic_deployment.py View File

@@ -1,553 +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
-"""
18
-Basic glance amulet functional tests.
19
-"""
20
-
21
-import amulet
22
-import time
23
-
24
-from charmhelpers.contrib.openstack.amulet.deployment import (
25
-    OpenStackAmuletDeployment
26
-)
27
-
28
-from charmhelpers.contrib.openstack.amulet.utils import (
29
-    OpenStackAmuletUtils,
30
-    DEBUG,
31
-    # ERROR
32
-)
33
-
34
-# Use DEBUG to turn on debug logging
35
-u = OpenStackAmuletUtils(DEBUG)
36
-
37
-
38
-class GlanceBasicDeployment(OpenStackAmuletDeployment):
39
-    """Amulet tests on a basic file-backed glance deployment.  Verify
40
-    relations, service status, endpoint service catalog, create and
41
-    delete new image."""
42
-
43
-    def __init__(self, series=None, openstack=None, source=None,
44
-                 stable=False):
45
-        """Deploy the entire test environment."""
46
-        super(GlanceBasicDeployment, self).__init__(series, openstack,
47
-                                                    source, stable)
48
-        self._add_services()
49
-        self._add_relations()
50
-        self._configure_services()
51
-        self._deploy()
52
-
53
-        u.log.info('Waiting on extended status checks...')
54
-        exclude_services = []
55
-        self._auto_wait_for_status(exclude_services=exclude_services)
56
-
57
-        self.d.sentry.wait()
58
-        self._initialize_tests()
59
-
60
-    def _assert_services(self, should_run):
61
-        if self._get_openstack_release() >= self.bionic_stein:
62
-            services = ('apache2', 'haproxy', 'glance-api')
63
-        else:
64
-            services = ('apache2', 'haproxy', 'glance-api', 'glance-registry')
65
-
66
-        u.get_unit_process_ids(
67
-            {self.glance_sentry: services},
68
-            expect_success=should_run)
69
-
70
-    def _add_services(self):
71
-        """Add services
72
-
73
-           Add the services that we're testing, where glance is local,
74
-           and the rest of the service are from lp branches that are
75
-           compatible with the local charm (e.g. stable or next).
76
-           """
77
-        this_service = {'name': 'glance'}
78
-        other_services = [
79
-            self.get_percona_service_entry(),
80
-            {'name': 'rabbitmq-server'},
81
-            {'name': 'keystone'},
82
-        ]
83
-        super(GlanceBasicDeployment, self)._add_services(this_service,
84
-                                                         other_services)
85
-
86
-    def _add_relations(self):
87
-        """Add relations for the services."""
88
-        relations = {'glance:identity-service': 'keystone:identity-service',
89
-                     'glance:shared-db': 'percona-cluster:shared-db',
90
-                     'keystone:shared-db': 'percona-cluster:shared-db',
91
-                     'glance:amqp': 'rabbitmq-server:amqp'}
92
-        super(GlanceBasicDeployment, self)._add_relations(relations)
93
-
94
-    def _configure_services(self):
95
-        """Configure all of the services."""
96
-        glance_config = {}
97
-        keystone_config = {
98
-            'admin-password': 'openstack',
99
-            'admin-token': 'ubuntutesting',
100
-        }
101
-        pxc_config = {
102
-            'dataset-size': '25%',
103
-            'max-connections': 1000,
104
-            'root-password': 'ChangeMe123',
105
-            'sst-password': 'ChangeMe123',
106
-        }
107
-        configs = {
108
-            'glance': glance_config,
109
-            'keystone': keystone_config,
110
-            'percona-cluster': pxc_config,
111
-        }
112
-        super(GlanceBasicDeployment, self)._configure_services(configs)
113
-
114
-    def _initialize_tests(self):
115
-        """Perform final initialization before tests get run."""
116
-        # Access the sentries for inspecting service units
117
-        self.pxc_sentry = self.d.sentry['percona-cluster'][0]
118
-        self.glance_sentry = self.d.sentry['glance'][0]
119
-        self.keystone_sentry = self.d.sentry['keystone'][0]
120
-        self.rabbitmq_sentry = self.d.sentry['rabbitmq-server'][0]
121
-        u.log.debug('openstack release val: {}'.format(
122
-            self._get_openstack_release()))
123
-        u.log.debug('openstack release str: {}'.format(
124
-            self._get_openstack_release_string()))
125
-
126
-        # Authenticate admin with keystone
127
-        self.keystone_session, self.keystone = u.get_default_keystone_session(
128
-            self.keystone_sentry,
129
-            openstack_release=self._get_openstack_release())
130
-
131
-        force_v1_client = False
132
-        if self._get_openstack_release() == self.trusty_icehouse:
133
-            # Updating image properties (such as arch or hypervisor) using the
134
-            # v2 api in icehouse results in:
135
-            # https://bugs.launchpad.net/python-glanceclient/+bug/1371559
136
-            u.log.debug('Forcing glance to use v1 api')
137
-            force_v1_client = True
138
-
139
-        # Authenticate admin with glance endpoint
140
-        self.glance = u.authenticate_glance_admin(
141
-            self.keystone,
142
-            force_v1_client=force_v1_client)
143
-
144
-    def test_100_services(self):
145
-        """Verify that the expected services are running on the
146
-           corresponding service units."""
147
-        services = {
148
-            self.keystone_sentry: ['keystone'],
149
-            self.rabbitmq_sentry: ['rabbitmq-server'],
150
-        }
151
-        if self._get_openstack_release() >= self.bionic_stein:
152
-            services.update(
153
-                {self.glance_sentry: ['glance-api']})
154
-        else:
155
-            services.update(
156
-                {self.glance_sentry: ['glance-api', 'glance-registry']})
157
-        if self._get_openstack_release() >= self.trusty_liberty:
158
-            services[self.keystone_sentry] = ['apache2']
159
-        ret = u.validate_services_by_name(services)
160
-        if ret:
161
-            amulet.raise_status(amulet.FAIL, msg=ret)
162
-
163
-    def test_102_service_catalog(self):
164
-        """Verify that the service catalog endpoint data is valid."""
165
-        u.log.debug('Checking keystone service catalog...')
166
-        endpoint_check = {
167
-            'adminURL': u.valid_url,
168
-            'id': u.not_null,
169
-            'region': 'RegionOne',
170
-            'publicURL': u.valid_url,
171
-            'internalURL': u.valid_url
172
-        }
173
-        expected = {
174
-            'image': [endpoint_check],
175
-            'identity': [endpoint_check]
176
-        }
177
-        actual = self.keystone.service_catalog.get_endpoints()
178
-
179
-        ret = u.validate_svc_catalog_endpoint_data(
180
-            expected,
181
-            actual,
182
-            openstack_release=self._get_openstack_release())
183
-        if ret:
184
-            amulet.raise_status(amulet.FAIL, msg=ret)
185
-
186
-    def test_104_glance_endpoint(self):
187
-        """Verify the glance endpoint data."""
188
-        u.log.debug('Checking glance api endpoint data...')
189
-        endpoints = self.keystone.endpoints.list()
190
-        admin_port = internal_port = public_port = '9292'
191
-        expected = {
192
-            'id': u.not_null,
193
-            'region': 'RegionOne',
194
-            'adminurl': u.valid_url,
195
-            'internalurl': u.valid_url,
196
-            'publicurl': u.valid_url,
197
-            'service_id': u.not_null
198
-        }
199
-        ret = u.validate_endpoint_data(
200
-            endpoints,
201
-            admin_port,
202
-            internal_port,
203
-            public_port,
204
-            expected,
205
-            openstack_release=self._get_openstack_release())
206
-        if ret:
207
-            amulet.raise_status(amulet.FAIL,
208
-                                msg='glance endpoint: {}'.format(ret))
209
-
210
-    def test_106_keystone_endpoint(self):
211
-        """Verify the keystone endpoint data."""
212
-        u.log.debug('Checking keystone api endpoint data...')
213
-        endpoints = self.keystone.endpoints.list()
214
-        admin_port = '35357'
215
-        internal_port = public_port = '5000'
216
-        expected = {
217
-            'id': u.not_null,
218
-            'region': 'RegionOne',
219
-            'adminurl': u.valid_url,
220
-            'internalurl': u.valid_url,
221
-            'publicurl': u.valid_url,
222
-            'service_id': u.not_null
223
-        }
224
-        ret = u.validate_endpoint_data(
225
-            endpoints,
226
-            admin_port,
227
-            internal_port,
228
-            public_port,
229
-            expected,
230
-            openstack_release=self._get_openstack_release())
231
-        if ret:
232
-            amulet.raise_status(amulet.FAIL,
233
-                                msg='keystone endpoint: {}'.format(ret))
234
-
235
-    def test_110_users(self):
236
-        """Verify expected users."""
237
-        u.log.debug('Checking keystone users...')
238
-        if self._get_openstack_release() >= self.xenial_queens:
239
-            expected = [
240
-                {'name': 'glance',
241
-                 'enabled': True,
242
-                 'default_project_id': u.not_null,
243
-                 'id': u.not_null,
244
-                 'email': 'juju@localhost'}
245
-            ]
246
-            domain = self.keystone.domains.find(name='service_domain')
247
-            actual = self.keystone.users.list(domain=domain)
248
-            api_version = 3
249
-        else:
250
-            expected = [
251
-                {'name': 'glance',
252
-                 'enabled': True,
253
-                 'tenantId': u.not_null,
254
-                 'id': u.not_null,
255
-                 'email': 'juju@localhost'},
256
-                {'name': 'admin',
257
-                 'enabled': True,
258
-                 'tenantId': u.not_null,
259
-                 'id': u.not_null,
260
-                 'email': 'juju@localhost'}
261
-            ]
262
-            actual = self.keystone.users.list()
263
-            api_version = 2
264
-        ret = u.validate_user_data(expected, actual, api_version)
265
-        if ret:
266
-            amulet.raise_status(amulet.FAIL, msg=ret)
267
-
268
-    def test_115_memcache(self):
269
-        u.validate_memcache(self.glance_sentry,
270
-                            '/etc/glance/glance-api.conf',
271
-                            self._get_openstack_release(),
272
-                            earliest_release=self.trusty_mitaka)
273
-        if self._get_openstack_release() < self.bionic_stein:
274
-            u.validate_memcache(self.glance_sentry,
275
-                                '/etc/glance/glance-registry.conf',
276
-                                self._get_openstack_release(),
277
-                                earliest_release=self.trusty_mitaka)
278
-
279
-    def test_200_mysql_glance_db_relation(self):
280
-        """Verify the mysql:glance shared-db relation data"""
281
-        u.log.debug('Checking mysql to glance shared-db relation data...')
282
-        unit = self.pxc_sentry
283
-        relation = ['shared-db', 'glance:shared-db']
284
-        expected = {
285
-            'private-address': u.valid_ip,
286
-            'db_host': u.valid_ip
287
-        }
288
-        ret = u.validate_relation_data(unit, relation, expected)
289
-        if ret:
290
-            message = u.relation_error('mysql shared-db', ret)
291
-            amulet.raise_status(amulet.FAIL, msg=message)
292
-
293
-    def test_201_glance_mysql_db_relation(self):
294
-        """Verify the glance:mysql shared-db relation data"""
295
-        u.log.debug('Checking glance to mysql shared-db relation data...')
296
-        unit = self.glance_sentry
297
-        relation = ['shared-db', 'percona-cluster:shared-db']
298
-        expected = {
299
-            'private-address': u.valid_ip,
300
-            'hostname': u.valid_ip,
301
-            'username': 'glance',
302
-            'database': 'glance'
303
-        }
304
-        ret = u.validate_relation_data(unit, relation, expected)
305
-        if ret:
306
-            message = u.relation_error('glance shared-db', ret)
307
-            amulet.raise_status(amulet.FAIL, msg=message)
308
-
309
-    def test_202_keystone_glance_id_relation(self):
310
-        """Verify the keystone:glance identity-service relation data"""
311
-        u.log.debug('Checking keystone to glance id relation data...')
312
-        unit = self.keystone_sentry
313
-        relation = ['identity-service',
314
-                    'glance:identity-service']
315
-        expected = {
316
-            'service_protocol': 'http',
317
-            'service_tenant': 'services',
318
-            'admin_token': 'ubuntutesting',
319
-            'service_password': u.not_null,
320
-            'service_port': '5000',
321
-            'auth_port': '35357',
322
-            'auth_protocol': 'http',
323
-            'private-address': u.valid_ip,
324
-            'auth_host': u.valid_ip,
325
-            'service_username': 'glance',
326
-            'service_tenant_id': u.not_null,
327
-            'service_host': u.valid_ip
328
-        }
329
-        ret = u.validate_relation_data(unit, relation, expected)
330
-        if ret:
331
-            message = u.relation_error('keystone identity-service', ret)
332
-            amulet.raise_status(amulet.FAIL, msg=message)
333
-
334
-    def test_203_glance_keystone_id_relation(self):
335
-        """Verify the glance:keystone identity-service relation data"""
336
-        u.log.debug('Checking glance to keystone relation data...')
337
-        unit = self.glance_sentry
338
-        relation = ['identity-service',
339
-                    'keystone:identity-service']
340
-        expected = {
341
-            'service': 'glance',
342
-            'region': 'RegionOne',
343
-            'public_url': u.valid_url,
344
-            'internal_url': u.valid_url,
345
-            'admin_url': u.valid_url,
346
-            'private-address': u.valid_ip
347
-        }
348
-        ret = u.validate_relation_data(unit, relation, expected)
349
-        if ret:
350
-            message = u.relation_error('glance identity-service', ret)
351
-            amulet.raise_status(amulet.FAIL, msg=message)
352
-
353
-    def test_204_rabbitmq_glance_amqp_relation(self):
354
-        """Verify the rabbitmq-server:glance amqp relation data"""
355
-        u.log.debug('Checking rmq to glance amqp relation data...')
356
-        unit = self.rabbitmq_sentry
357
-        relation = ['amqp', 'glance:amqp']
358
-        expected = {
359
-            'private-address': u.valid_ip,
360
-            'password': u.not_null,
361
-            'hostname': u.valid_ip
362
-        }
363
-        ret = u.validate_relation_data(unit, relation, expected)
364
-        if ret:
365
-            message = u.relation_error('rabbitmq amqp', ret)
366
-            amulet.raise_status(amulet.FAIL, msg=message)
367
-
368
-    def test_205_glance_rabbitmq_amqp_relation(self):
369
-        """Verify the glance:rabbitmq-server amqp relation data"""
370
-        u.log.debug('Checking glance to rmq amqp relation data...')
371
-        unit = self.glance_sentry
372
-        relation = ['amqp', 'rabbitmq-server:amqp']
373
-        expected = {
374
-            'private-address': u.valid_ip,
375
-            'vhost': 'openstack',
376
-            'username': u.not_null
377
-        }
378
-        ret = u.validate_relation_data(unit, relation, expected)
379
-        if ret:
380
-            message = u.relation_error('glance amqp', ret)
381
-            amulet.raise_status(amulet.FAIL, msg=message)
382
-
383
-    def test_302_glance_registry_default_config(self):
384
-        """Verify configs in glance-registry.conf"""
385
-        if self._get_openstack_release() >= self.bionic_stein:
386
-            u.log.debug('Skipping check of glance registry config file for '
387
-                        '>= bionic-stein')
388
-            return
389
-        u.log.debug('Checking glance registry config file...')
390
-        unit = self.glance_sentry
391
-        rel_my_gl = self.pxc_sentry.relation('shared-db', 'glance:shared-db')
392
-        if self._get_openstack_release() < self.xenial_queens:
393
-            dialect = 'mysql'
394
-        else:
395
-            dialect = 'mysql+pymysql'
396
-        db_uri = "{}://{}:{}@{}/{}".format(dialect,
397
-                                           'glance',
398
-                                           rel_my_gl['password'],
399
-                                           rel_my_gl['db_host'],
400
-                                           'glance')
401
-        conf = '/etc/glance/glance-registry.conf'
402
-
403
-        expected = {
404
-            'DEFAULT': {
405
-                'use_syslog': 'False',
406
-                'log_file': '/var/log/glance/registry.log',
407
-                'debug': 'False',
408
-                'verbose': 'False',
409
-                'bind_host': '0.0.0.0',
410
-                'bind_port': '9191'
411
-            },
412
-        }
413
-
414
-        if self._get_openstack_release() >= self.trusty_kilo:
415
-            # Kilo or later
416
-            expected['database'] = {
417
-                'idle_timeout': '3600',
418
-                'connection': db_uri
419
-            }
420
-        else:
421
-            # Juno or earlier
422
-            expected['database'] = {
423
-                'idle_timeout': '3600',
424
-                'connection': db_uri
425
-            }
426
-
427
-        for section, pairs in expected.iteritems():
428
-            ret = u.validate_config_data(unit, conf, section, pairs)
429
-            if ret:
430
-                message = "glance registry paste config error: {}".format(ret)
431
-                amulet.raise_status(amulet.FAIL, msg=message)
432
-
433
-    def test_410_glance_image_create_delete(self):
434
-        """Create new cirros image in glance, verify, then delete it."""
435
-        u.log.debug('Creating, checking and deleting glance image...')
436
-        img_new = u.create_cirros_image(self.glance, "cirros-image-1")
437
-        img_id = img_new.id
438
-        u.delete_resource(self.glance.images, img_id, msg="glance image")
439
-
440
-    def test_411_set_disk_format(self):
441
-        sleep_time = 30
442
-        if self._get_openstack_release() >= self.trusty_kilo:
443
-            section = 'image_format'
444
-        elif self._get_openstack_release() > self.trusty_icehouse:
445
-            section = 'DEFAULT'
446
-        else:
447
-            u.log.debug('Test not supported before juno')
448
-            return
449
-        sentry = self.glance_sentry
450
-        juju_service = 'glance'
451
-
452
-        # Expected default and alternate values
453
-        set_default = {
454
-            'disk-formats': 'ami,ari,aki,vhd,vmdk,raw,qcow2,vdi,iso,root-tar'}
455
-        set_alternate = {'disk-formats': 'qcow2'}
456
-
457
-        # Config file affected by juju set config change
458
-        conf_file = '/etc/glance/glance-api.conf'
459
-
460
-        # Make config change, check for service restarts
461
-        u.log.debug('Setting disk format {}...'.format(juju_service))
462
-        self.d.configure(juju_service, set_alternate)
463
-
464
-        u.log.debug('Sleeping to let hooks fire')
465
-        time.sleep(sleep_time)
466
-        u.log.debug("Checking disk format option has updated")
467
-        ret = u.validate_config_data(
468
-            sentry,
469
-            conf_file,
470
-            section,
471
-            {'disk_formats': 'qcow2'})
472
-        if ret:
473
-            msg = "disk_formats was not updated in section {} in {}".format(
474
-                section,
475
-                conf_file)
476
-            amulet.raise_status(amulet.FAIL, msg=msg)
477
-
478
-        self.d.configure(juju_service, set_default)
479
-
480
-    def test_500_security_checklist_action(self):
481
-        """Verify expected result on a default install"""
482
-        u.log.debug("Testing security-checklist")
483
-        sentry_unit = self.glance_sentry
484
-
485
-        action_id = u.run_action(sentry_unit, "security-checklist")
486
-        u.wait_on_action(action_id)
487
-        data = amulet.actions.get_action_output(action_id, full_output=True)
488
-        assert data.get(u"status") == "failed", \
489
-            "Security check is expected to not pass by default"
490
-
491
-    def test_900_glance_restart_on_config_change(self):
492
-        """Verify that the specified services are restarted when the config
493
-           is changed."""
494
-        sentry = self.glance_sentry
495
-        juju_service = 'glance'
496
-
497
-        # Expected default and alternate values
498
-        set_default = {'use-syslog': 'False'}
499
-        set_alternate = {'use-syslog': 'True'}
500
-
501
-        # Config file affected by juju set config change
502
-        conf_file = '/etc/glance/glance-api.conf'
503
-
504
-        # Services which are expected to restart upon config change
505
-        services = {
506
-            'glance-api': conf_file,
507
-        }
508
-        if self._get_openstack_release() < self.bionic_stein:
509
-            services.update({'glance-registry': conf_file})
510
-
511
-        # Make config change, check for service restarts
512
-        u.log.debug('Making config change on {}...'.format(juju_service))
513
-        mtime = u.get_sentry_time(sentry)
514
-        self.d.configure(juju_service, set_alternate)
515
-
516
-        sleep_time = 30
517
-        for s, conf_file in services.iteritems():
518
-            u.log.debug("Checking that service restarted: {}".format(s))
519
-            if not u.validate_service_config_changed(sentry, mtime, s,
520
-                                                     conf_file,
521
-                                                     retry_count=4,
522
-                                                     retry_sleep_time=20,
523
-                                                     sleep_time=sleep_time):
524
-                self.d.configure(juju_service, set_default)
525
-                msg = "service {} didn't restart after config change".format(s)
526
-                amulet.raise_status(amulet.FAIL, msg=msg)
527
-            sleep_time = 0
528
-
529
-        self.d.configure(juju_service, set_default)
530
-
531
-    def test_901_pause_resume(self):
532
-        """Test pause and resume actions."""
533
-        u.log.debug('Checking pause and resume actions...')
534
-
535
-        unit = self.d.sentry['glance'][0]
536
-        unit_name = unit.info['unit_name']
537
-        u.log.debug("Unit name: {}".format(unit_name))
538
-
539
-        u.log.debug('Checking for active status on {}'.format(unit_name))
540
-        assert u.status_get(unit)[0] == "active"
541
-
542
-        u.log.debug('Running pause action on {}'.format(unit_name))
543
-        self._assert_services(should_run=True)
544
-        action_id = u.run_action(unit, "pause")
545
-        u.log.debug('Waiting on action {}'.format(action_id))
546
-        assert u.wait_on_action(action_id), "Pause action failed."
547
-        self._assert_services(should_run=False)
548
-
549
-        u.log.debug('Running resume action on {}'.format(unit_name))
550
-        action_id = u.run_action(unit, "resume")
551
-        u.log.debug('Waiting on action {}'.format(action_id))
552
-        assert u.wait_on_action(action_id), "Resume action failed"
553
-        self._assert_services(should_run=True)

+ 33
- 0
tests/bundles/bionic-queens.yaml View File

@@ -0,0 +1,33 @@
1
+series: bionic
2
+
3
+comment:
4
+  - 'machines section to decide order of deployment. database sooner = faster'
5
+
6
+machines:
7
+  '0':
8
+    constraints: mem=3072M
9
+  '1':
10
+  '2':
11
+
12
+relations:
13
+  - ["keystone:shared-db", "mysql:shared-db"]
14
+  - ["glance:shared-db", "mysql:shared-db"]
15
+  - ["glance:identity-service", "keystone:identity-service"]
16
+
17
+applications:
18
+  mysql:
19
+    charm: cs:~openstack-charmers-next/percona-cluster
20
+    num_units: 1
21
+    to:
22
+      - '0'
23
+  keystone:
24
+    series: bionic
25
+    charm: cs:~openstack-charmers-next/keystone
26
+    num_units: 1
27
+    to:
28
+      - '1'
29
+  glance:
30
+    charm: ../../../glance
31
+    num_units: 1
32
+    to:
33
+      - '2'

+ 36
- 0
tests/bundles/bionic-rocky.yaml View File

@@ -0,0 +1,36 @@
1
+series: bionic
2
+
3
+comment:
4
+  - 'machines section to decide order of deployment. database sooner = faster'
5
+
6
+machines:
7
+  '0':
8
+    constraints: mem=3072M
9
+  '1':
10
+  '2':
11
+
12
+relations:
13
+  - ["keystone:shared-db", "mysql:shared-db"]
14
+  - ["glance:shared-db", "mysql:shared-db"]
15
+  - ["glance:identity-service", "keystone:identity-service"]
16
+
17
+applications:
18
+  mysql:
19
+    charm: cs:~openstack-charmers-next/percona-cluster
20
+    num_units: 1
21
+    to:
22
+    - '0'
23
+  keystone:
24
+    charm: cs:~openstack-charmers-next/keystone
25
+    num_units: 1
26
+    options:
27
+      openstack-origin: cloud:bionic-rocky
28
+    to:
29
+    - '1'
30
+  glance:
31
+    charm: ../../../glance
32
+    num_units: 1
33
+    options:
34
+      openstack-origin: cloud:bionic-rocky
35
+    to:
36
+    - '2'

+ 36
- 0
tests/bundles/bionic-stein.yaml View File

@@ -0,0 +1,36 @@
1
+series: bionic
2
+
3
+comment:
4
+  - 'machines section to decide order of deployment. database sooner = faster'
5
+
6
+machines:
7
+  '0':
8
+    constraints: mem=3072M
9
+  '1':
10
+  '2':
11
+
12
+relations:
13
+  - ["keystone:shared-db", "mysql:shared-db"]
14
+  - ["glance:shared-db", "mysql:shared-db"]
15
+  - ["glance:identity-service", "keystone:identity-service"]
16
+
17
+applications:
18
+  mysql:
19
+    charm: cs:~openstack-charmers-next/percona-cluster
20
+    num_units: 1
21
+    to:
22
+      - '0'
23
+  keystone:
24
+    charm: cs:~openstack-charmers-next/keystone
25
+    num_units: 1
26
+    options:
27
+      openstack-origin: cloud:bionic-stein
28
+    to:
29
+      - '1'
30
+  glance:
31
+    charm: ../../../glance
32
+    num_units: 1
33
+    options:
34
+      openstack-origin: cloud:bionic-stein
35
+    to:
36
+    - '2'

+ 36
- 0
tests/bundles/bionic-train.yaml View File

@@ -0,0 +1,36 @@
1
+series: bionic
2
+
3
+comment:
4
+  - 'machines section to decide order of deployment. database sooner = faster'
5
+
6
+machines:
7
+  '0':
8
+    constraints: mem=3072M
9
+  '1':
10
+  '2':
11
+
12
+relations:
13
+  - ["keystone:shared-db", "mysql:shared-db"]
14
+  - ["glance:shared-db", "mysql:shared-db"]
15
+  - ["glance:identity-service", "keystone:identity-service"]
16
+
17
+applications:
18
+  mysql:
19
+    charm: cs:~openstack-charmers-next/percona-cluster
20
+    num_units: 1
21
+    to:
22
+      - '0'
23
+  keystone:
24
+    charm: cs:~openstack-charmers-next/keystone
25
+    num_units: 1
26
+    options:
27
+      openstack-origin: cloud:bionic-train
28
+    to:
29
+      - '1'
30
+  glance:
31
+    charm: ../../../glance
32
+    num_units: 1
33
+    options:
34
+      openstack-origin: cloud:bionic-train
35
+    to:
36
+    - '2'

+ 35
- 0
tests/bundles/disco-stein.yaml View File

@@ -0,0 +1,35 @@
1
+series: disco
2
+
3
+comment:
4
+  - 'machines section to decide order of deployment. database sooner = faster'
5
+
6
+machines:
7
+  '0':
8
+    constraints: mem=3072M
9
+  '1':
10
+  '2':
11
+
12
+relations:
13
+  - - keystone:shared-db
14
+    - mysql:shared-db
15
+  - - glance:shared-db
16
+    - mysql:shared-db
17
+  - - glance:identity-service
18
+    - keystone:identity-service
19
+
20
+applications:
21
+  mysql:
22
+    charm: cs:~openstack-charmers-next/percona-cluster
23
+    num_units: 1
24
+    to:
25
+      - '0'
26
+  keystone:
27
+    charm: cs:~openstack-charmers-next/keystone
28
+    num_units: 1
29
+    to:
30
+      - '1'
31
+  glance:
32
+    charm: ../../../glance
33
+    num_units: 1
34
+    to:
35
+      - '2'

+ 39
- 0
tests/bundles/trusty-mitaka.yaml View File

@@ -0,0 +1,39 @@
1
+series: trusty
2
+
3
+comment:
4
+  - 'machines section to decide order of deployment. database sooner = faster'
5
+  - 'virt-type=kvm is workaround while awaiting new release of python-libjuju'
6
+
7
+machines:
8
+  '0':
9
+    constraints: virt-type=kvm mem=3072M
10
+  '1':
11
+    constraints: virt-type=kvm
12
+  '2':
13
+    constraints: virt-type=kvm
14
+
15
+relations:
16
+  - ["keystone:shared-db", "mysql:shared-db"]
17
+  - ["glance:shared-db", "mysql:shared-db"]
18
+  - ["glance:identity-service", "keystone:identity-service"]
19
+
20
+applications:
21
+  mysql:
22
+    charm: cs:trusty/percona-cluster
23
+    num_units: 1
24
+    to:
25
+      - '0'
26
+  keystone:
27
+    charm: cs:~openstack-charmers-next/keystone
28
+    num_units: 1
29
+    options:
30
+      openstack-origin: cloud:trusty-mitaka
31
+    to:
32
+      - '1'
33
+  glance:
34
+    charm: ../../../glance
35
+    num_units: 1
36
+    options:
37
+      openstack-origin: cloud:trusty-mitaka
38
+    to:
39
+      - '2'

+ 32
- 0
tests/bundles/xenial-mitaka.yaml View File

@@ -0,0 +1,32 @@
1
+series: xenial
2
+
3
+comment:
4
+  - 'machines section to decide order of deployment. database sooner = faster'
5
+
6
+machines:
7
+  '0':
8
+    constraints: mem=3072M
9
+  '1':
10
+  '2':
11
+
12
+relations:
13
+  - ["keystone:shared-db", "mysql:shared-db"]
14
+  - ["glance:shared-db", "mysql:shared-db"]
15
+  - ["glance:identity-service", "keystone:identity-service"]
16
+
17
+applications:
18
+  mysql:
19
+    charm: cs:~openstack-charmers-next/percona-cluster
20
+    num_units: 1
21
+    to:
22
+      - '0'
23
+  keystone:
24
+    charm: cs:~openstack-charmers-next/keystone
25
+    num_units: 1
26
+    to:
27
+      - '1'
28
+  glance:
29
+    charm: ../../../glance
30
+    num_units: 1
31
+    to:
32
+      - '2'

+ 36
- 0
tests/bundles/xenial-ocata.yaml View File

@@ -0,0 +1,36 @@
1
+series: xenial
2
+
3
+comment:
4
+  - 'machines section to decide order of deployment. database sooner = faster'
5
+
6
+machines:
7
+  '0':
8
+    constraints: mem=3072M
9
+  '1':
10
+  '2':
11
+
12
+relations:
13
+  - ["keystone:shared-db", "mysql:shared-db"]
14
+  - ["glance:shared-db", "mysql:shared-db"]
15
+  - ["glance:identity-service", "keystone:identity-service"]
16
+
17
+applications:
18
+  mysql:
19
+    charm: cs:~openstack-charmers-next/percona-cluster
20
+    num_units: 1
21
+    to:
22
+      - '0'
23
+  keystone:
24
+    charm: cs:~openstack-charmers-next/keystone
25
+    num_units: 1
26
+    options:
27
+      openstack-origin: cloud:xenial-ocata
28
+    to:
29
+      - '1'
30
+  glance:
31
+    charm: ../../../glance
32
+    num_units: 1
33
+    options:
34
+      openstack-origin: cloud:xenial-ocata
35
+    to:
36
+      - '2'

+ 36
- 0
tests/bundles/xenial-pike.yaml View File

@@ -0,0 +1,36 @@
1
+series: xenial
2
+
3
+comment:
4
+  - 'machines section to decide order of deployment. database sooner = faster'
5
+
6
+machines:
7
+  '0':
8
+    constraints: mem=3072M
9
+  '1':
10
+  '2':
11
+
12
+relations:
13
+  - ["keystone:shared-db", "mysql:shared-db"]
14
+  - ["glance:shared-db", "mysql:shared-db"]
15
+  - ["glance:identity-service", "keystone:identity-service"]
16
+
17
+applications:
18
+  mysql:
19
+    charm: cs:~openstack-charmers-next/percona-cluster
20
+    num_units: 1
21
+    to:
22
+      - '0'
23
+  keystone:
24
+    charm: cs:~openstack-charmers-next/keystone
25
+    num_units: 1
26
+    options:
27
+      openstack-origin: cloud:xenial-pike
28
+    to:
29
+      - '1'
30
+  glance:
31
+    charm: ../../../glance
32
+    num_units: 1
33
+    options:
34
+      openstack-origin: cloud:xenial-pike
35
+    to:
36
+      - '2'

+ 36
- 0
tests/bundles/xenial-queens.yaml View File

@@ -0,0 +1,36 @@
1
+series: xenial
2
+
3
+comment:
4
+  - 'machines section to decide order of deployment. database sooner = faster'
5
+
6
+machines:
7
+  '0':
8
+    constraints: mem=3072M
9
+  '1':
10
+  '2':
11
+
12
+relations:
13
+  - ["keystone:shared-db", "mysql:shared-db"]
14
+  - ["glance:shared-db", "mysql:shared-db"]
15
+  - ["glance:identity-service", "keystone:identity-service"]
16
+
17
+applications:
18
+  mysql:
19
+    charm: cs:~openstack-charmers-next/percona-cluster
20
+    num_units: 1
21
+    to:
22
+    - '0'
23
+  keystone:
24
+    charm: cs:~openstack-charmers-next/keystone
25
+    num_units: 1
26
+    options:
27
+      openstack-origin: cloud:xenial-queens
28
+    to:
29
+    - '1'
30
+  glance:
31
+    charm: ../../../glance
32
+    num_units: 1
33
+    options:
34
+      openstack-origin: cloud:xenial-queens
35
+    to:
36
+    - '2'

+ 0
- 1587
tests/charmhelpers/contrib/openstack/amulet/utils.py
File diff suppressed because it is too large
View File


+ 0
- 1066
tests/charmhelpers/core/host.py
File diff suppressed because it is too large
View File


+ 0
- 23
tests/dev-basic-cosmic-rocky View File

@@ -1,23 +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 Glance deployment on cosmic-rocky."""
18
-
19
-from basic_deployment import GlanceBasicDeployment
20
-
21
-if __name__ == '__main__':
22
-    deployment = GlanceBasicDeployment(series='cosmic')
23
-    deployment.run_tests()

+ 0
- 23
tests/gate-basic-bionic-queens View File

@@ -1,23 +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 Glance deployment on bionic-queens."""
18
-
19
-from basic_deployment import GlanceBasicDeployment
20
-
21
-if __name__ == '__main__':
22
-    deployment = GlanceBasicDeployment(series='bionic')
23
-    deployment.run_tests()

+ 0
- 25
tests/gate-basic-bionic-rocky 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 glance deployment on bionic-rocky."""
18
-
19
-from basic_deployment import GlanceBasicDeployment
20
-
21
-if __name__ == '__main__':
22
-    deployment = GlanceBasicDeployment(series='bionic',
23
-                                         openstack='cloud:bionic-rocky',
24
-                                         source='cloud:bionic-updates/rocky')
25
-    deployment.run_tests()

+ 0
- 25
tests/gate-basic-bionic-stein 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 glance deployment on bionic-stein."""
18
-
19
-from basic_deployment import GlanceBasicDeployment
20
-
21
-if __name__ == '__main__':
22
-    deployment = GlanceBasicDeployment(series='bionic',
23
-                                         openstack='cloud:bionic-stein',
24
-                                         source='cloud:bionic-stein')
25
-    deployment.run_tests()

+ 0
- 23
tests/gate-basic-disco-stein View File

@@ -1,23 +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 Glance deployment on disco-stein."""
18
-
19
-from basic_deployment import GlanceBasicDeployment
20
-
21
-if __name__ == '__main__':
22
-    deployment = GlanceBasicDeployment(series='disco')
23
-    deployment.run_tests()

+ 0
- 25
tests/gate-basic-trusty-mitaka 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 glance deployment on trusty-mitaka."""
18
-
19
-from basic_deployment import GlanceBasicDeployment
20
-
21
-if __name__ == '__main__':
22
-    deployment = GlanceBasicDeployment(series='trusty',
23
-                                         openstack='cloud:trusty-mitaka',
24
-                                         source='cloud:trusty-updates/mitaka')
25
-    deployment.run_tests()

+ 0
- 23
tests/gate-basic-xenial-mitaka View File

@@ -1,23 +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 Glance deployment on xenial-mitaka."""
18
-
19
-from basic_deployment import GlanceBasicDeployment
20
-
21
-if __name__ == '__main__':
22
-    deployment = GlanceBasicDeployment(series='xenial')
23
-    deployment.run_tests()

+ 0
- 25
tests/gate-basic-xenial-ocata 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 glance deployment on xenial-ocata."""
18
-
19
-from basic_deployment import GlanceBasicDeployment
20
-
21
-if __name__ == '__main__':
22
-    deployment = GlanceBasicDeployment(series='xenial',
23
-                                         openstack='cloud:xenial-ocata',
24
-                                         source='cloud:xenial-updates/ocata')
25
-    deployment.run_tests()

+ 0
- 25
tests/gate-basic-xenial-pike 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 glance deployment on xenial-pike."""
18
-
19
-from basic_deployment import GlanceBasicDeployment
20
-
21
-if __name__ == '__main__':
22
-    deployment = GlanceBasicDeployment(series='xenial',
23
-                                         openstack='cloud:xenial-pike',
24
-                                         source='cloud:xenial-updates/pike')
25
-    deployment.run_tests()

+ 0
- 25
tests/gate-basic-xenial-queens 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 glance deployment on xenial-queens."""
18
-
19
-from basic_deployment import GlanceBasicDeployment
20
-
21
-if __name__ == '__main__':
22
-    deployment = GlanceBasicDeployment(series='xenial',
23
-                                         openstack='cloud:xenial-queens',
24
-                                         source='cloud:xenial-updates/queens')
25
-    deployment.run_tests()

+ 25
- 18
tests/tests.yaml View File

@@ -1,18 +1,25 @@
1
-# Bootstrap the model if necessary.
2
-bootstrap: True
3
-# Re-use bootstrap node.
4
-reset: True
5
-# Use tox/requirements to drive the venv instead of bundletester's venv feature.
6
-virtualenv: False
7
-# Leave makefile empty, otherwise unit/lint tests will rerun ahead of amulet.
8
-makefile: []
9
-# Do not specify juju PPA sources.  Juju is presumed to be pre-installed
10
-# and configured in all test runner environments.
11
-#sources:
12
-# Do not specify or rely on system packages.
13
-#packages:
14
-# Do not specify python packages here.  Use test-requirements.txt
15
-# and tox instead.  ie. The venv is constructed before bundletester
16
-# is invoked.
17
-#python-packages:
18
-reset_timeout: 600
1
+charm_name: glance
2
+
3
+comment:
4
+  - 'the glance configure job validates operation of identity-service relation'
5
+
6
+configure:
7
+  - zaza.openstack.charm_tests.glance.setup.add_lts_image
8
+
9
+smoke_bundles:
10
+  - bionic-stein
11
+gate_bundles:
12
+  - trusty-mitaka
13
+  - xenial-mitaka
14
+  - xenial-ocata
15
+  - xenial-pike
16
+  - xenial-queens
17
+  - bionic-queens
18
+  - bionic-rocky
19
+  - bionic-stein
20
+  - disco-stein
21
+dev_bundles:
22
+  - bionic-train
23
+
24
+tests:
25
+  - zaza.openstack.charm_tests.glance.tests.GlanceTest

+ 23
- 43
tox.ini View File

@@ -2,7 +2,7 @@
2 2
 # This file is managed centrally by release-tools and should not be modified
3 3
 # within individual charm repos.
4 4
 [tox]
5
-envlist = pep8,py27,py37
5
+envlist = pep8,py37
6 6
 skipsdist = True
7 7
 # NOTE(beisner): Avoid build/test env pollution by not enabling sitepackages.
8 8
 sitepackages = False
@@ -13,18 +13,12 @@ skip_missing_interpreters = False
13 13
 setenv = VIRTUAL_ENV={envdir}
14 14
          PYTHONHASHSEED=0
15 15
          CHARM_DIR={envdir}
16
-         AMULET_SETUP_TIMEOUT=5400
17 16
 install_command =
18 17
   pip install {opts} {packages}
19 18
 commands = stestr run {posargs}
20 19
 whitelist_externals = juju
21
-passenv = HOME TERM AMULET_* CS_API_* OS_*
22
-
23
-[testenv:py27]
24
-basepython = python2.7
25
-deps = -r{toxinidir}/requirements.txt
26
-       -r{toxinidir}/test-requirements.txt
27
-commands = /bin/true
20
+passenv = HOME TERM CS_API_* OS_*
21
+deps = -r{toxinidir}/test-requirements.txt
28 22
 
29 23
 [testenv:py35]
30 24
 basepython = python3.5
@@ -41,6 +35,11 @@ basepython = python3.7
41 35
 deps = -r{toxinidir}/requirements.txt
42 36
        -r{toxinidir}/test-requirements.txt
43 37
 
38
+[testenv:py3]
39
+basepython = python3
40
+deps = -r{toxinidir}/requirements.txt
41
+       -r{toxinidir}/test-requirements.txt
42
+
44 43
 [testenv:pep8]
45 44
 basepython = python3
46 45
 deps = -r{toxinidir}/requirements.txt
@@ -80,49 +79,30 @@ omit =
80 79
 basepython = python3
81 80
 commands = {posargs}
82 81
 
83
-[testenv:func27-noop]
84
-# DRY RUN - For Debug
85
-basepython = python2.7
86
-deps = -r{toxinidir}/requirements.txt
87
-       -r{toxinidir}/test-requirements.txt
82
+[testenv:func-noop]
83
+basepython = python3
88 84
 commands =
89
-    bundletester -vl DEBUG -r json -o func-results.json --test-pattern "gate-*" -n --no-destroy
85
+    /bin/true
90 86
 
91
-[testenv:func27]
92
-# Charm Functional Test
93
-# Run all gate tests which are +x (expected to always pass)
94
-basepython = python2.7
95
-deps = -r{toxinidir}/requirements.txt
96
-       -r{toxinidir}/test-requirements.txt
87
+[testenv:func]
88
+basepython = python3
97 89
 commands =
98
-    bundletester -vl DEBUG -r json -o func-results.json --test-pattern "gate-*" --no-destroy
90
+    functest-run-suite --keep-model
99 91
 
100
-[testenv:func27-smoke]
101
-# Charm Functional Test
102
-# Run a specific test as an Amulet smoke test (expected to always pass)
103
-basepython = python2.7
104
-deps = -r{toxinidir}/requirements.txt
105
-       -r{toxinidir}/test-requirements.txt
92
+[testenv:func-smoke]
93
+basepython = python3
106 94
 commands =
107
-    bundletester -vl DEBUG -r json -o func-results.json gate-basic-bionic-stein --no-destroy
95
+    functest-run-suite --keep-model --smoke
108 96
 
109
-[testenv:func27-dfs]
110
-# Charm Functional Test
111
-# Run all deploy-from-source tests which are +x (may not always pass!)
112
-basepython = python2.7
113
-deps = -r{toxinidir}/requirements.txt
114
-       -r{toxinidir}/test-requirements.txt
97
+[testenv:func-dev]
98
+basepython = python3
115 99
 commands =
116
-    bundletester -vl DEBUG -r json -o func-results.json --test-pattern "dfs-*" --no-destroy
100
+    functest-run-suite --keep-model --dev
117 101
 
118
-[testenv:func27-dev]
119
-# Charm Functional Test
120
-# Run all development test targets which are +x (may not always pass!)
121
-basepython = python2.7
122
-deps = -r{toxinidir}/requirements.txt
123
-       -r{toxinidir}/test-requirements.txt
102
+[testenv:func-target]
103
+basepython = python3
124 104
 commands =
125
-    bundletester -vl DEBUG -r json -o func-results.json --test-pattern "dev-*" --no-destroy
105
+    functest-run-suite --keep-model --bundle {posargs}
126 106
 
127 107
 [flake8]
128 108
 ignore = E402,E226

Loading…
Cancel
Save