| #!/usr/bin/python3 | |
| import amulet | |
| import unittest | |
| class TestCharm(unittest.TestCase): | |
| def setUp(self): | |
| self.d = amulet.Deployment(series='trusty') | |
| self.d.add('ubuntu', 'cs:trusty/ubuntu') | |
| self.d.add('logstash', 'cs:~containers/trusty/logstash-2') | |
| self.d.add('filebeat') | |
| self.d.relate('filebeat:beats-host', 'ubuntu:juju-info') | |
| self.d.relate('filebeat:logstash', 'logstash:filebeat') | |
| self.d.setup(timeout=900) | |
| self.d.sentry.wait() | |
| self.unit = self.d.sentry['filebeat'][0] | |
| def test_logstash_host_in_templating(self): | |
| stash_address = self.unit.relation('logstash', 'logstash:filebeat')['private-address'] # noqa | |
| remote = self.unit.file_contents('/etc/filebeat/filebeat.yml') | |
| self.assertTrue(stash_address in remote) | |
| if __name__ == "__main__": | |
| unittest.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment