Created
March 21, 2016 13:07
-
-
Save anonymous/b252865ec752459f01f8 to your computer and use it in GitHub Desktop.
10-deploy.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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