~james-page/charms/trusty/mongodb/ch-resync-newton

« back to all changes in this revision

Viewing changes to tests/50_relate_ceilometer_test.py

  • Committer: Matthew Bruzek
  • Date: 2015-12-16 20:22:02 UTC
  • mfrom: (78.2.22 fix-dump-actions)
  • Revision ID: matthew.bruzek@canonical.com-20151216202202-1q7s6olfvm0gkuud
[everlast] The dump action was not working. Now it works and if args has spaces, they can be escaped with quotes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
                getattr(self, test)()
33
33
 
34
34
    def test_mongo_relation(self):
35
 
        unit = self.deploy.sentry.unit['ceilometer/0']
36
 
        mongo = self.deploy.sentry.unit['mongodb/0'].info['public-address']
 
35
        unit = self.deploy.sentry['ceilometer'][0]
 
36
        mongo = self.deploy.sentry['mongodb'][0].info['public-address']
 
37
        mongo_reladdr = self.deploy.sentry['mongodb'][0].relation(
 
38
            'database', 'ceilometer:shared-db')
37
39
        cont = unit.file_contents('/etc/ceilometer/ceilometer.conf')
38
 
        if mongo not in cont:
 
40
        if (mongo not in cont and mongo_reladdr.get(
 
41
                'hostname', 'I SURE HOPE NOT') not in cont):
39
42
            amulet.raise_status(amulet.FAIL, "Unable to verify ceilometer cfg")
40
43
 
41
44
if __name__ == '__main__':