~celebdor/charms/trusty/neutron-api/plugin_pkg_fix

« back to all changes in this revision

Viewing changes to tests/basic_deployment.py

  • Committer: Liam Young
  • Date: 2015-10-19 06:36:41 UTC
  • mfrom: (152.1.5 neutron-api)
  • Revision ID: liam.young@canonical.com-20151019063641-leixdk02j0dnv2g0
Tags: 15.10
[1chb1n, r=gnuoy] Update amulet tests for Trusty-Liberty, Wily-Liberty.

Sync charmhelpers.

Add service and relations to satisfy workload status ready state.

Add new logic to wait for extended status message to confirm deploy is ready, before testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python
2
 
"""
3
 
Basic neutron-api functional test.
4
 
"""
5
 
 
6
1
import amulet
7
2
import os
8
 
import time
9
3
import yaml
10
4
 
11
5
from charmhelpers.contrib.openstack.amulet.deployment import (
35
29
        self._add_relations()
36
30
        self._configure_services()
37
31
        self._deploy()
 
32
 
 
33
        u.log.info('Waiting on extended status checks...')
 
34
        exclude_services = ['mysql']
 
35
        self._auto_wait_for_status(exclude_services=exclude_services)
 
36
 
38
37
        self._initialize_tests()
39
38
 
40
39
    def _add_services(self):
48
47
        other_services = [{'name': 'mysql'},
49
48
                          {'name': 'rabbitmq-server'},
50
49
                          {'name': 'keystone'},
 
50
                          {'name': 'glance'},  # to satisfy workload status
51
51
                          {'name': 'neutron-openvswitch'},
52
52
                          {'name': 'nova-cloud-controller'},
53
53
                          {'name': 'neutron-gateway'},
68
68
            'nova-compute:neutron-plugin': 'neutron-openvswitch:'
69
69
                                           'neutron-plugin',
70
70
            'nova-cloud-controller:shared-db': 'mysql:shared-db',
 
71
            'neutron-gateway:amqp': 'rabbitmq-server:amqp',
 
72
            'nova-cloud-controller:amqp': 'rabbitmq-server:amqp',
 
73
            'nova-compute:amqp': 'rabbitmq-server:amqp',
 
74
            'neutron-openvswitch:amqp': 'rabbitmq-server:amqp',
 
75
            'nova-cloud-controller:identity-service': 'keystone:'
 
76
                                                      'identity-service',
 
77
            'nova-cloud-controller:cloud-compute': 'nova-compute:'
 
78
                                                   'cloud-compute',
 
79
            'glance:identity-service': 'keystone:identity-service',
 
80
            'glance:shared-db': 'mysql:shared-db',
 
81
            'glance:amqp': 'rabbitmq-server:amqp',
 
82
            'nova-compute:image-service': 'glance:image-service',
 
83
            'nova-cloud-controller:image-service': 'glance:image-service',
71
84
        }
72
85
 
73
86
        # NOTE(beisner): relate this separately due to the resulting
158
171
            self._get_openstack_release()))
159
172
        u.log.debug('openstack release str: {}'.format(
160
173
            self._get_openstack_release_string()))
161
 
        # Let things settle a bit before moving forward
162
 
        time.sleep(30)
163
174
 
164
175
    def test_100_services(self):
165
176
        """Verify the expected services are running on the corresponding
226
237
            'password': u.not_null
227
238
        }
228
239
 
229
 
        if self._get_openstack_release() == self.precise_icehouse:
230
 
            # Precise
231
 
            expected['allowed_units'] = 'nova-cloud-controller/0 neutron-api/0'
232
 
        else:
233
 
            # Not Precise
234
 
            expected['allowed_units'] = 'neutron-api/0'
235
 
 
236
240
        ret = u.validate_relation_data(unit, relation, expected)
237
241
        if ret:
238
242
            message = u.relation_error('mysql shared-db', ret)