45
45
error_message = 'Error, python version 2 is required for this test.'
46
46
amulet.raise_status(amulet.FAIL, msg=error_message)
48
d = amulet.Deployment(series='trusty')
49
d = amulet.Deployment(series=series)
49
50
# Add rabbitmq-server to the deployment.
50
51
d.add('rabbitmq-server', units=scale)
51
# Add the ceph charm to the deployment.
53
# Add cinder to the deployment to test the AMQP relation.
55
# Add hacluster to the deployment to test the ha relation.
53
# TODO(billy-olsen) - Rework this following set of code to be more in-line
54
# with how the other openstack services are done. For now, we want to test
55
# the current branch with the appropriate branches of related charms in
56
# order to test /next with /next branches and /trunk with /trunk branches.
60
def determine_charm_branches(services):
64
svc['location'] = temp.format(svc['name'])
67
temp = 'lp:~openstack-charmers/charms/{}/{}/next'
68
svc['location'] = temp.format(series, svc['name'])
73
def add_services(services):
75
Adds services to the deployment. The input is a list of dicts with
76
the key of 'name' name for the service name. The branch location
77
will be determined automatically.
79
services = determine_charm_branches(services)
82
d.add(svc['name'], charm=svc['location'])
88
{'name': 'hacluster'},
91
# Add the services to the deployment
92
add_services(services_to_add)
57
94
# The ceph charm requires configuration to deploy successfully.
58
95
d.configure('ceph', ceph_configuration)
59
96
# Configure the cinder charm.
104
141
# Iterate over every rabbitmq-unit to get the different relations.
105
142
for rabbit_unit in rabbit_units:
106
143
###########################################################################
108
145
###########################################################################
109
146
# Verify the ceph relation was created for the rabbit unit.
110
147
rabbit_relation = rabbit_unit.relation('ceph', 'ceph:client')
169
206
###########################################################################
170
## Verify that the rabbitmq cluster status is correct.
207
# Verify that the rabbitmq cluster status is correct.
171
208
###########################################################################
172
209
# Create the command that checks if the rabbitmq-server service is running.
173
210
command = 'rabbitmqctl cluster_status'
183
220
print('The rabbitmq-server cluster status is OK.')
185
222
###############################################################################
186
## Test the AMQP messages can be sent from and read from another.
223
# Test the AMQP messages can be sent from and read from another.
187
224
###############################################################################
188
225
# Get the public address for rabbitmq-server instance 0.
189
226
send_address = rabbit_units[0].info['public-address']