summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Beisner <ryan.beisner@canonical.com>2016-07-19 04:02:13 +0000
committerRyan Beisner <ryan.beisner@canonical.com>2016-07-20 04:00:40 +0000
commite460db6f64000b347c1b3dd336c47593e8e83924 (patch)
tree064796383194c3fa80c11ee6fb5dad06b003b845
parent5718e2b9c19cf7ecd5773c429352c4394d5cde13 (diff)
Use bundletester for amulet test execution
Switch to using bundletester for execution of functional tests, leveraging tox to build out test virtualenvs. Rename amulet tests inline with gate-*, dev-* and dfs-* naming standards. Update README to refer to functional testing section of the charm guide. Also remove brittle auth conf checks which are failing at cinder-ceph master. Even without those explicit checks, if auth fails, functional tests will still fail and catch issues in gate. Change-Id: I7b0009fa0e29dcaf7d6e5607af7b397e437aac79
Notes
Notes (review): Verified+1: Canonical CI <uosci-testing-bot@ubuntu.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: Thu, 21 Jul 2016 09:12:37 +0000 Reviewed-on: https://review.openstack.org/344004 Project: openstack/charm-cinder-backup Branch: refs/heads/master
-rw-r--r--Makefile2
-rw-r--r--test-requirements.txt16
-rwxr-xr-xtests/00-setup31
-rwxr-xr-xtests/016-basic-trusty-juno25
-rw-r--r--tests/README68
-rw-r--r--tests/README.md9
-rw-r--r--tests/basic_deployment.py85
-rwxr-xr-xtests/dev-basic-xenial-newton (renamed from tests/018-basic-vivid-kilo)8
-rwxr-xr-xtests/dev-basic-yakkety-newton (renamed from tests/019-basic-wily-liberty)6
-rwxr-xr-xtests/gate-basic-precise-icehouse (renamed from tests/014-basic-precise-icehouse)2
-rwxr-xr-xtests/gate-basic-trusty-icehouse (renamed from tests/015-basic-trusty-icehouse)2
-rwxr-xr-xtests/gate-basic-trusty-kilo (renamed from tests/017-basic-trusty-kilo)2
-rwxr-xr-xtests/gate-basic-xenial-mitaka (renamed from tests/021-basic-xenial-mitaka)2
-rw-r--r--tests/tests.yaml37
-rw-r--r--tox.ini48
15 files changed, 137 insertions, 206 deletions
diff --git a/Makefile b/Makefile
index c05df85..3138238 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,7 @@ test:
10 10
11functional_test: 11functional_test:
12 @echo Starting amulet deployment tests... 12 @echo Starting amulet deployment tests...
13 @juju test -v -p AMULET_HTTP_PROXY,AMULET_OS_VIP --timeout 2700 13 @tox -e func27
14 14
15bin/charm_helpers_sync.py: 15bin/charm_helpers_sync.py:
16 @mkdir -p bin 16 @mkdir -p bin
diff --git a/test-requirements.txt b/test-requirements.txt
index 4faf254..74baa12 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -7,3 +7,19 @@ flake8>=2.2.4,<=2.4.1
7os-testr>=0.4.1 7os-testr>=0.4.1
8charm-tools>=2.0.0 8charm-tools>=2.0.0
9requests==2.6.0 9requests==2.6.0
10# BEGIN: Amulet OpenStack Charm Helper Requirements
11# Liberty client lower constraints
12amulet>=1.14.3,<2.0
13bundletester>=0.6.1,<1.0
14python-ceilometerclient>=1.5.0,<2.0
15python-cinderclient>=1.4.0,<2.0
16python-glanceclient>=1.1.0,<2.0
17python-heatclient>=0.8.0,<1.0
18python-keystoneclient>=1.7.1,<2.0
19python-neutronclient>=3.1.0,<4.0
20python-novaclient>=2.30.1,<3.0
21python-openstackclient>=1.7.0,<2.0
22python-swiftclient>=2.6.0,<3.0
23pika>=0.10.0,<1.0
24distro-info
25# END: Amulet OpenStack Charm Helper Requirements
diff --git a/tests/00-setup b/tests/00-setup
deleted file mode 100755
index 14711e9..0000000
--- a/tests/00-setup
+++ /dev/null
@@ -1,31 +0,0 @@
1#!/bin/bash
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
17set -ex
18
19sudo add-apt-repository --yes ppa:juju/stable
20sudo apt-get update --yes
21sudo apt-get install --yes amulet \
22 distro-info-data \
23 python-cinderclient \
24 python-distro-info \
25 python-glanceclient \
26 python-heatclient \
27 python-keystoneclient \
28 python-neutronclient \
29 python-novaclient \
30 python-pika \
31 python-swiftclient
diff --git a/tests/016-basic-trusty-juno b/tests/016-basic-trusty-juno
deleted file mode 100755
index ae39b77..0000000
--- a/tests/016-basic-trusty-juno
+++ /dev/null
@@ -1,25 +0,0 @@
1#!/usr/bin/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 trusty-juno."""
18
19from basic_deployment import CinderBackupBasicDeployment
20
21if __name__ == '__main__':
22 deployment = CinderBackupBasicDeployment(series='trusty',
23 openstack='cloud:trusty-juno',
24 source='cloud:trusty-updates/juno')
25 deployment.run_tests()
diff --git a/tests/README b/tests/README
deleted file mode 100644
index 2e81818..0000000
--- a/tests/README
+++ /dev/null
@@ -1,68 +0,0 @@
1This directory provides Amulet tests that focus on verification of
2cinder-backup deployments.
3
4test_* methods are called in lexical sort order.
5
6Test name convention to ensure desired test order:
7 1xx service and endpoint checks
8 2xx relation checks
9 3xx config checks
10 4xx functional checks
11 9xx restarts and other final checks
12
13Common uses of backend relations in deployments:
14 - [ cinder, cinder-ceph ]
15 - [ cinder, cinder-backup ]
16 - [ cinder-ceph, ceph ]
17 - [ cinder-backup, ceph ]
18
19In order to run tests, you'll need charm-tools installed (in addition to
20juju, of course):
21 sudo add-apt-repository ppa:juju/stable
22 sudo apt-get update
23 sudo apt-get install charm-tools
24
25If you use a web proxy server to access the web, you'll need to set the
26AMULET_HTTP_PROXY environment variable to the http URL of the proxy server.
27
28The following examples demonstrate different ways that tests can be executed.
29All examples are run from the charm's root directory.
30
31 * To run all tests (starting with 00-setup):
32
33 make test
34
35 * To run a specific test module (or modules):
36
37 juju test -v -p AMULET_HTTP_PROXY 15-basic-trusty-icehouse
38
39 * To run a specific test module (or modules), and keep the environment
40 deployed after a failure:
41
42 juju test --set-e -v -p AMULET_HTTP_PROXY 15-basic-trusty-icehouse
43
44 * To re-run a test module against an already deployed environment (one
45 that was deployed by a previous call to 'juju test --set-e'):
46
47 ./tests/15-basic-trusty-icehouse
48
49For debugging and test development purposes, all code should be idempotent.
50In other words, the code should have the ability to be re-run without changing
51the results beyond the initial run. This enables editing and re-running of a
52test module against an already deployed environment, as described above.
53
54Manual debugging tips:
55
56 * Set the following env vars before using the OpenStack CLI as admin:
57 export OS_AUTH_URL=http://`juju-deployer -f keystone 2>&1 | tail -n 1`:5000/v2.0
58 export OS_TENANT_NAME=admin
59 export OS_USERNAME=admin
60 export OS_PASSWORD=openstack
61 export OS_REGION_NAME=RegionOne
62
63 * Set the following env vars before using the OpenStack CLI as demoUser:
64 export OS_AUTH_URL=http://`juju-deployer -f keystone 2>&1 | tail -n 1`:5000/v2.0
65 export OS_TENANT_NAME=demoTenant
66 export OS_USERNAME=demoUser
67 export OS_PASSWORD=password
68 export OS_REGION_NAME=RegionOne
diff --git a/tests/README.md b/tests/README.md
new file mode 100644
index 0000000..046be7f
--- /dev/null
+++ b/tests/README.md
@@ -0,0 +1,9 @@
1# Overview
2
3This directory provides Amulet tests to verify basic deployment functionality
4from the perspective of this charm, its requirements and its features, as
5exercised in a subset of the full OpenStack deployment test bundle topology.
6
7For full details on functional testing of OpenStack charms please refer to
8the [functional testing](http://docs.openstack.org/developer/charm-guide/testing.html#functional-testing)
9section of the OpenStack Charm Guide.
diff --git a/tests/basic_deployment.py b/tests/basic_deployment.py
index 7b66066..43d63f9 100644
--- a/tests/basic_deployment.py
+++ b/tests/basic_deployment.py
@@ -1,4 +1,4 @@
1#!/usr/bin/python 1#!/usr/bin/env python
2# 2#
3# Copyright 2016 Canonical Ltd 3# Copyright 2016 Canonical Ltd
4# 4#
@@ -45,6 +45,14 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
45 self._add_relations() 45 self._add_relations()
46 self._configure_services() 46 self._configure_services()
47 self._deploy() 47 self._deploy()
48
49 u.log.info('Waiting on extended status checks...')
50
51 # XXX: cinder-backup workload status ignored until it grows support
52 # https://bugs.launchpad.net/bugs/1604580
53 exclude_services = ['mysql', 'cinder-backup']
54 self._auto_wait_for_status(exclude_services=exclude_services)
55
48 self._initialize_tests() 56 self._initialize_tests()
49 57
50 def _add_services(self): 58 def _add_services(self):
@@ -118,25 +126,19 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
118 def _initialize_tests(self): 126 def _initialize_tests(self):
119 """Perform final initialization before tests get run.""" 127 """Perform final initialization before tests get run."""
120 # Access the sentries for inspecting service units 128 # Access the sentries for inspecting service units
121 u.log.debug('!!!!!') 129 self.mysql_sentry = self.d.sentry['mysql'][0]
122 u.log.debug(dir(self.d.sentry)) 130 self.keystone_sentry = self.d.sentry['keystone'][0]
123 131 self.rabbitmq_sentry = self.d.sentry['rabbitmq-server'][0]
124 self.mysql_sentry = self.d.sentry.unit['mysql/0'] 132 self.cinder_sentry = self.d.sentry['cinder'][0]
125 self.keystone_sentry = self.d.sentry.unit['keystone/0'] 133 self.ceph0_sentry = self.d.sentry['ceph'][0]
126 self.rabbitmq_sentry = self.d.sentry.unit['rabbitmq-server/0'] 134 self.ceph1_sentry = self.d.sentry['ceph'][1]
127 self.cinder_sentry = self.d.sentry.unit['cinder/0'] 135 self.ceph2_sentry = self.d.sentry['ceph'][2]
128 self.ceph0_sentry = self.d.sentry.unit['ceph/0'] 136 self.cinder_backup_sentry = self.d.sentry['cinder-backup'][0]
129 self.ceph1_sentry = self.d.sentry.unit['ceph/1']
130 self.ceph2_sentry = self.d.sentry.unit['ceph/2']
131 self.cinder_backup_sentry = self.d.sentry.unit['cinder-backup/0']
132 u.log.debug('openstack release val: {}'.format( 137 u.log.debug('openstack release val: {}'.format(
133 self._get_openstack_release())) 138 self._get_openstack_release()))
134 u.log.debug('openstack release str: {}'.format( 139 u.log.debug('openstack release str: {}'.format(
135 self._get_openstack_release_string())) 140 self._get_openstack_release_string()))
136 141
137 # Let things settle a bit original moving forward
138 time.sleep(30)
139
140 # Authenticate admin with keystone 142 # Authenticate admin with keystone
141 self.keystone = u.authenticate_keystone_admin(self.keystone_sentry, 143 self.keystone = u.authenticate_keystone_admin(self.keystone_sentry,
142 user='admin', 144 user='admin',
@@ -322,7 +324,14 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
322 324
323 def get_broker_response(self): 325 def get_broker_response(self):
324 broker_request = self.get_broker_request() 326 broker_request = self.get_broker_request()
325 response_key = "broker-rsp-cinder-backup-0" 327 u.log.debug('Broker request: {}'.format(broker_request))
328
329 response_key = "broker-rsp-{}-{}".format(
330 self.cinder_backup_sentry.info['service'],
331 self.cinder_backup_sentry.info['unit']
332 )
333 u.log.debug('Checking response_key: {}'.format(response_key))
334
326 ceph_sentrys = [self.ceph0_sentry, 335 ceph_sentrys = [self.ceph0_sentry,
327 self.ceph1_sentry, 336 self.ceph1_sentry,
328 self.ceph2_sentry] 337 self.ceph2_sentry]
@@ -332,6 +341,7 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
332 broker_response = json.loads(relation_data[response_key]) 341 broker_response = json.loads(relation_data[response_key])
333 if (broker_request['request-id'] == 342 if (broker_request['request-id'] ==
334 broker_response['request-id']): 343 broker_response['request-id']):
344 u.log.debug('broker_response: {}'.format(broker_response))
335 return broker_response 345 return broker_response
336 346
337 def test_200_cinderbackup_ceph_ceph_relation(self): 347 def test_200_cinderbackup_ceph_ceph_relation(self):
@@ -374,11 +384,6 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
374 if ret: 384 if ret:
375 msg = u.relation_error('cinder cinder-backup backup-backend', ret) 385 msg = u.relation_error('cinder cinder-backup backup-backend', ret)
376 amulet.raise_status(amulet.FAIL, msg=msg) 386 amulet.raise_status(amulet.FAIL, msg=msg)
377 broker_response = self.get_broker_response()
378 if not broker_response or broker_response['exit-code'] != 0:
379 msg = ('Broker request invalid'
380 ' or failed: {}'.format(broker_response))
381 amulet.raise_status(amulet.FAIL, msg=msg)
382 387
383 def test_202_cinderbackup_cinder_backend_relation(self): 388 def test_202_cinderbackup_cinder_backend_relation(self):
384 u.log.debug('Checking cinder-backup:backup-backend to ' 389 u.log.debug('Checking cinder-backup:backup-backend to '
@@ -525,15 +530,7 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
525 unit = self.cinder_sentry 530 unit = self.cinder_sentry
526 conf = '/etc/cinder/cinder.conf' 531 conf = '/etc/cinder/cinder.conf'
527 unit_mq = self.rabbitmq_sentry 532 unit_mq = self.rabbitmq_sentry
528 unit_ks = self.keystone_sentry
529 rel_mq_ci = unit_mq.relation('amqp', 'cinder:amqp') 533 rel_mq_ci = unit_mq.relation('amqp', 'cinder:amqp')
530 rel_ks_ci = unit_ks.relation('identity-service',
531 'cinder:identity-service')
532
533 auth_uri = 'http://' + rel_ks_ci['auth_host'] + \
534 ':' + rel_ks_ci['service_port'] + '/'
535 auth_url = ('http://%s:%s/' %
536 (rel_ks_ci['auth_host'], rel_ks_ci['auth_port']))
537 534
538 expected = { 535 expected = {
539 'DEFAULT': { 536 'DEFAULT': {
@@ -549,12 +546,6 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
549 'backup_ceph_pool': 'cinder-backup', 546 'backup_ceph_pool': 'cinder-backup',
550 'backup_ceph_user': 'cinder-backup' 547 'backup_ceph_user': 'cinder-backup'
551 }, 548 },
552 'keystone_authtoken': {
553 'admin_user': rel_ks_ci['service_username'],
554 'admin_password': rel_ks_ci['service_password'],
555 'admin_tenant_name': rel_ks_ci['service_tenant'],
556 'auth_uri': auth_uri
557 },
558 'cinder-ceph': { 549 'cinder-ceph': {
559 'volume_backend_name': 'cinder-ceph', 550 'volume_backend_name': 'cinder-ceph',
560 'volume_driver': 'cinder.volume.drivers.rbd.RBDDriver', 551 'volume_driver': 'cinder.volume.drivers.rbd.RBDDriver',
@@ -569,18 +560,6 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
569 'rabbit_password': rel_mq_ci['password'], 560 'rabbit_password': rel_mq_ci['password'],
570 'rabbit_host': rel_mq_ci['hostname'], 561 'rabbit_host': rel_mq_ci['hostname'],
571 } 562 }
572 if self._get_openstack_release() >= self.trusty_liberty:
573 expected['keystone_authtoken'] = {
574 'auth_uri': auth_uri.rstrip('/'),
575 'auth_url': auth_url.rstrip('/'),
576 'auth_plugin': 'password',
577 'project_domain_id': 'default',
578 'user_domain_id': 'default',
579 'project_name': 'services',
580 'username': rel_ks_ci['service_username'],
581 'password': rel_ks_ci['service_password'],
582 'signing_dir': '/var/cache/cinder'
583 }
584 563
585 if self._get_openstack_release() >= self.trusty_kilo: 564 if self._get_openstack_release() >= self.trusty_kilo:
586 # Kilo or later 565 # Kilo or later
@@ -588,8 +567,6 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
588 else: 567 else:
589 # Juno or earlier 568 # Juno or earlier
590 expected['DEFAULT'].update(expected_rmq) 569 expected['DEFAULT'].update(expected_rmq)
591 expected['keystone_authtoken']['auth_host'] = \
592 rel_ks_ci['auth_host']
593 570
594 for section, pairs in expected.iteritems(): 571 for section, pairs in expected.iteritems():
595 ret = u.validate_config_data(unit, conf, section, pairs) 572 ret = u.validate_config_data(unit, conf, section, pairs)
@@ -631,7 +608,15 @@ class CinderBackupBasicDeployment(OpenStackAmuletDeployment):
631 u.log.debug('Cinder api check (volumes.list): {}'.format(check)) 608 u.log.debug('Cinder api check (volumes.list): {}'.format(check))
632 assert(check == []) 609 assert(check == [])
633 610
634 def test_401_create_delete_volume(self): 611 def test_401_check_broker_reponse(self):
612 u.log.debug('Checking broker response')
613 broker_response = self.get_broker_response()
614 if not broker_response or broker_response['exit-code'] != 0:
615 msg = ('Broker request invalid'
616 ' or failed: {}'.format(broker_response))
617 amulet.raise_status(amulet.FAIL, msg=msg)
618
619 def test_402_create_delete_volume(self):
635 """Create a cinder volume and delete it.""" 620 """Create a cinder volume and delete it."""
636 u.log.debug('Creating, checking and deleting cinder volume...') 621 u.log.debug('Creating, checking and deleting cinder volume...')
637 vol_new = u.create_cinder_volume(self.cinder) 622 vol_new = u.create_cinder_volume(self.cinder)
diff --git a/tests/018-basic-vivid-kilo b/tests/dev-basic-xenial-newton
index 9efad00..93fcc99 100755
--- a/tests/018-basic-vivid-kilo
+++ b/tests/dev-basic-xenial-newton
@@ -1,4 +1,4 @@
1#!/usr/bin/python 1#!/usr/bin/env python
2# 2#
3# Copyright 2016 Canonical Ltd 3# Copyright 2016 Canonical Ltd
4# 4#
@@ -14,10 +14,12 @@
14# See the License for the specific language governing permissions and 14# See the License for the specific language governing permissions and
15# limitations under the License. 15# limitations under the License.
16 16
17"""Amulet tests on a basic cinder-backup deployment on vivid-kilo.""" 17"""Amulet tests on a basic cinder backup deployment on xenial-newton."""
18 18
19from basic_deployment import CinderBackupBasicDeployment 19from basic_deployment import CinderBackupBasicDeployment
20 20
21if __name__ == '__main__': 21if __name__ == '__main__':
22 deployment = CinderBackupBasicDeployment(series='vivid') 22 deployment = CinderBackupBasicDeployment(series='xenial',
23 openstack='cloud:xenial-newton',
24 source='cloud:xenial-updates/newton')
23 deployment.run_tests() 25 deployment.run_tests()
diff --git a/tests/019-basic-wily-liberty b/tests/dev-basic-yakkety-newton
index 966396e..c79d7bd 100755
--- a/tests/019-basic-wily-liberty
+++ b/tests/dev-basic-yakkety-newton
@@ -1,4 +1,4 @@
1#!/usr/bin/python 1#!/usr/bin/env python
2# 2#
3# Copyright 2016 Canonical Ltd 3# Copyright 2016 Canonical Ltd
4# 4#
@@ -14,10 +14,10 @@
14# See the License for the specific language governing permissions and 14# See the License for the specific language governing permissions and
15# limitations under the License. 15# limitations under the License.
16 16
17"""Amulet tests on a basic cinder-backup deployment on wily-liberty.""" 17"""Amulet tests on a basic Cinder backup deployment on yakkety-newton."""
18 18
19from basic_deployment import CinderBackupBasicDeployment 19from basic_deployment import CinderBackupBasicDeployment
20 20
21if __name__ == '__main__': 21if __name__ == '__main__':
22 deployment = CinderBackupBasicDeployment(series='wily') 22 deployment = CinderBackupBasicDeployment(series='yakkety')
23 deployment.run_tests() 23 deployment.run_tests()
diff --git a/tests/014-basic-precise-icehouse b/tests/gate-basic-precise-icehouse
index 7e624ae..06843b7 100755
--- a/tests/014-basic-precise-icehouse
+++ b/tests/gate-basic-precise-icehouse
@@ -1,4 +1,4 @@
1#!/usr/bin/python 1#!/usr/bin/env python
2# 2#
3# Copyright 2016 Canonical Ltd 3# Copyright 2016 Canonical Ltd
4# 4#
diff --git a/tests/015-basic-trusty-icehouse b/tests/gate-basic-trusty-icehouse
index 5009514..0e9863a 100755
--- a/tests/015-basic-trusty-icehouse
+++ b/tests/gate-basic-trusty-icehouse
@@ -1,4 +1,4 @@
1#!/usr/bin/python 1#!/usr/bin/env python
2# 2#
3# Copyright 2016 Canonical Ltd 3# Copyright 2016 Canonical Ltd
4# 4#
diff --git a/tests/017-basic-trusty-kilo b/tests/gate-basic-trusty-kilo
index 3752f3c..ac759ca 100755
--- a/tests/017-basic-trusty-kilo
+++ b/tests/gate-basic-trusty-kilo
@@ -1,4 +1,4 @@
1#!/usr/bin/python 1#!/usr/bin/env python
2# 2#
3# Copyright 2016 Canonical Ltd 3# Copyright 2016 Canonical Ltd
4# 4#
diff --git a/tests/021-basic-xenial-mitaka b/tests/gate-basic-xenial-mitaka
index ccd6fce..b61481a 100755
--- a/tests/021-basic-xenial-mitaka
+++ b/tests/gate-basic-xenial-mitaka
@@ -1,4 +1,4 @@
1#!/usr/bin/python 1#!/usr/bin/env python
2# 2#
3# Copyright 2016 Canonical Ltd 3# Copyright 2016 Canonical Ltd
4# 4#
diff --git a/tests/tests.yaml b/tests/tests.yaml
index 64e3e2d..e3185c6 100644
--- a/tests/tests.yaml
+++ b/tests/tests.yaml
@@ -1,20 +1,17 @@
1bootstrap: true 1# Bootstrap the model if necessary.
2reset: true 2bootstrap: True
3virtualenv: true 3# Re-use bootstrap node instead of destroying/re-bootstrapping.
4makefile: 4reset: True
5 - lint 5# Use tox/requirements to drive the venv instead of bundletester's venv feature.
6 - test 6virtualenv: False
7sources: 7# Leave makefile empty, otherwise unit/lint tests will rerun ahead of amulet.
8 - ppa:juju/stable 8makefile: []
9packages: 9# Do not specify juju PPA sources. Juju is presumed to be pre-installed
10 - amulet 10# and configured in all test runner environments.
11 - distro-info-data 11#sources:
12 - python-cinderclient 12# Do not specify or rely on system packages.
13 - python-distro-info 13#packages:
14 - python-glanceclient 14# Do not specify python packages here. Use test-requirements.txt
15 - python-heatclient 15# and tox instead. ie. The venv is constructed before bundletester
16 - python-keystoneclient 16# is invoked.
17 - python-neutronclient 17#python-packages:
18 - python-novaclient
19 - python-pika
20 - python-swiftclient
diff --git a/tox.ini b/tox.ini
index a4d9c0d..39b3aad 100644
--- a/tox.ini
+++ b/tox.ini
@@ -5,6 +5,8 @@ skipsdist = True
5[testenv] 5[testenv]
6setenv = VIRTUAL_ENV={envdir} 6setenv = VIRTUAL_ENV={envdir}
7 PYTHONHASHSEED=0 7 PYTHONHASHSEED=0
8 AMULET_SETUP_TIMEOUT=2700
9passenv = HOME TERM AMULET_HTTP_PROXY AMULET_OS_VIP
8install_command = 10install_command =
9 pip install --allow-unverified python-apt {opts} {packages} 11 pip install --allow-unverified python-apt {opts} {packages}
10commands = ostestr {posargs} 12commands = ostestr {posargs}
@@ -18,12 +20,56 @@ deps = -r{toxinidir}/requirements.txt
18basepython = python2.7 20basepython = python2.7
19deps = -r{toxinidir}/requirements.txt 21deps = -r{toxinidir}/requirements.txt
20 -r{toxinidir}/test-requirements.txt 22 -r{toxinidir}/test-requirements.txt
21commands = flake8 {posargs} hooks unit_tests tests 23commands = flake8 {posargs} --exclude */charmhelpers hooks unit_tests tests
22 charm-proof 24 charm-proof
23 25
24[testenv:venv] 26[testenv:venv]
25commands = {posargs} 27commands = {posargs}
26 28
29[testenv:func27-noop]
30# DRY RUN - For Debug
31basepython = python2.7
32deps = -r{toxinidir}/requirements.txt
33 -r{toxinidir}/test-requirements.txt
34commands =
35 bundletester -vl DEBUG -r json -o func-results.json --test-pattern "gate-*" -n --no-destroy
36
37[testenv:func27]
38# Charm Functional Test
39# Run all gate tests which are +x (expected to always pass)
40basepython = python2.7
41deps = -r{toxinidir}/requirements.txt
42 -r{toxinidir}/test-requirements.txt
43commands =
44 bundletester -vl DEBUG -r json -o func-results.json --test-pattern "gate-*" --no-destroy
45
46[testenv:func27-smoke]
47# Charm Functional Test
48# Run a specific test as an Amulet smoke test (expected to always pass)
49basepython = python2.7
50deps = -r{toxinidir}/requirements.txt
51 -r{toxinidir}/test-requirements.txt
52commands =
53 bundletester -vl DEBUG -r json -o func-results.json gate-basic-xenial-mitaka --no-destroy
54
55[testenv:func27-dfs]
56# Charm Functional Test
57# Run all deploy-from-source tests which are +x (may not always pass!)
58basepython = python2.7
59deps = -r{toxinidir}/requirements.txt
60 -r{toxinidir}/test-requirements.txt
61commands =
62 bundletester -vl DEBUG -r json -o func-results.json --test-pattern "dfs-*" --no-destroy
63
64[testenv:func27-dev]
65# Charm Functional Test
66# Run all development test targets which are +x (may not always pass!)
67basepython = python2.7
68deps = -r{toxinidir}/requirements.txt
69 -r{toxinidir}/test-requirements.txt
70commands =
71 bundletester -vl DEBUG -r json -o func-results.json --test-pattern "dev-*" --no-destroy
72
27[flake8] 73[flake8]
28ignore = E402,E226 74ignore = E402,E226
29exclude = hooks/charmhelpers 75exclude = hooks/charmhelpers