~lazypower/charms/trusty/elasticsearch/amulet-test-bump

« back to all changes in this revision

Viewing changes to tests/01-config-changes

  • Committer: Charles Butler
  • Date: 2016-05-04 03:11:36 UTC
  • Revision ID: charles.butler@canonical.com-20160504031136-0op94pml0mf4drps
- Merged tests into a single amulet TestClass
- Refactored the tests due to consistent failures when testing on GCE
- minor lint cleanups

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/python3
2
 
import amulet
3
 
import helpers
4
 
 
5
 
d = amulet.Deployment(series='trusty')
6
 
 
7
 
d.add('elasticsearch')
8
 
config = {'cluster-name': 'unique-name'}
9
 
d.configure('elasticsearch', config)
10
 
 
11
 
helpers.setup_deployment(d)
12
 
 
13
 
health = helpers.get_cluster_health(d)
14
 
 
15
 
cluster_name = health['cluster_name']
16
 
 
17
 
if cluster_name != 'unique-name':
18
 
    msg = ("Expected cluster name to be 'unique-name' "
19
 
           "but was '{}'.".format(cluster_name))
20
 
    amulet.raise_status(amulet.FAIL, msg=msg)
21
 
 
22
 
print("Successfully created cluster with non-default cluster-name.")